class X::Parameter::Default does X::Comp { }

Compile-time error thrown when a parameter in a signature has default value, but isn't allowed to have one. That is the case with slurpy parameters (because a slurpy always binds successfully, even to zero arguments) and with mandatory parameters.


sub f($x! = 3{ }

dies with

Cannot put default on required parameter $x


sub f(*@ = 3{ }

dies with

Cannot put default on anonymous slurpy parameter


method how§

Returns a string describing how the parameter is qualified that makes it disallow default values, for example "slurpy" or "mandatory".

method parameter§

Returns the parameter name


Type relations for X::Parameter::Default
raku-type-graph X::Parameter::Default X::Parameter::Default Exception Exception X::Parameter::Default->Exception X::Comp X::Comp X::Parameter::Default->X::Comp Mu Mu Any Any Any->Mu Exception->Any X::Comp->Exception

Expand chart above