class X::Composition::NotComposable is Exception { }

Thrown when trying to compose a type into a target type, but the composer type cannot be used for composition (roles and enums are generally OK).

For example

class B { }
class C does B { }

dies with

===SORRY!===
␤B is not composable, so C cannot compose it

because does is reserved for role composition, and B is not a role, nor something that knows how to turn into a role.

The fix is to either make B a role, or use inheritance (class C is B { }) instead.

Methods§

method target-name§

method target-name(--> Str:D)

Returns the name of the type that should be composed, but failed.

method composer§

method composer(--> Mu)

Returns the type that should be composed into the target, but which isn't a role.