perl6/doc/lib/X/Parameter/WrongOrder

doc src
(title) X::Parameter::WrongOrder
    class X::Parameter::WrongOrder does X::Comp

 
Compile time error that is thrown when parameters in a signature in the wrong order (for example if an optional parameter comes before a mandatory parameter). For example
    sub f($a?, $b) { }

 
produces
    Cannot put required parameter $b after optional parameters

 

Methods

(head2) misplaced
Returns the kind of misplaced parameter (for example "mandatory" , "positional" ).
(head2) parameter
Returns the name of the (first) misplaced parameter
(head2) after
Returns a string describing other parameters after which the current parameter was illegally placed (for example "variadic" , "positional" or "optional" ).

Perl 6 Tricks and Treats newsletter

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