Camelia

class X::Composition::NotComposable

src
    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 A { }
    class B does A { }

 
dies with
    ===SORRY!===
    ␤A is not composable, so B cannot compose it

 
because does is reserved for role composition, and A is not a role, nor something that knows how to turn into a role. The fix is to either make A a role, or use inheritance ( class B is A { } ) instead.

Methods

target-name

    method target-name() returns Str:D

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

composer

    method composer() returns Mu

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

Perl 6 Tricks and Treats newsletter

Register to the free newsletter now, and get updates and news.
Email:
Name: