-
Notifications
You must be signed in to change notification settings - Fork 292
/
WrongOrder.pod6
41 lines (25 loc) 路 919 Bytes
/
WrongOrder.pod6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
=begin pod
=TITLE class X::Parameter::WrongOrder
=SUBTITLE Compilation error due to passing parameters in the wrong order
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
=for code :skip-test<compile time error>
sub f($a?, $b) { }
dies with
=for code :lang<text>
===SORRY!===
Cannot put required parameter $b after optional parameters
=head1 Methods
=head2 method misplaced
Returns the kind of misplaced parameter (for example C<"mandatory">,
C<"positional">).
=head2 method parameter
Returns the name of the (first) misplaced parameter
=head2 method after
Returns a string describing other parameters after which the current parameter
was illegally placed (for example C<"variadic">, C<"positional"> or
C<"optional">).
=end pod