class X::Role::Initialization is Exception { }

Thrown when the SomeRole($init) syntax is used, but SomeRole does not have exactly one public attribute.

For example:

role R { }"D2" but R(2)
CATCH { default { put .^name''.Str } }
# OUTPUT: «X::Role::Initialization: Can only supply an initialization value for a role if it has a single public attribute, but this is not the case for 'R'␤» 


method role§

method role()

Returns the role that caused the error.


Type relations for X::Role::Initialization
raku-type-graph X::Role::Initialization X::Role::Initialization Exception Exception X::Role::Initialization->Exception Mu Mu Any Any Any->Mu Exception->Any

Expand chart above