# New Ticket Created by  diakopter 
# Please include the string:  [perl #54800]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=54800 >


rakudo is currently ignoring named arguments if there is an optional
positional argument missing.  Not only does it ignore the passed value
for $y, it also ignores the default value for $y provided in the
declaration.


17:06
       rakudo: sub foo(:$y = 2, $x?){ say "$x"~"|"~"$y"}; foo(:y(3), 1);
17:06
       exp_evalbot
       OUTPUT[1|3␤]
17:06
       diakopter
       rakudo: sub foo($x?, :$y = 2){ say "$x"~"|"~"$y"}; foo(:y(3), 1);
17:06
       exp_evalbot
       OUTPUT[1|3␤]
17:06
       diakopter
       rakudo: sub foo($x?, :$y = 2){ say "$x"~"|"~"$y"}; foo(1, :y(3));
17:06
       exp_evalbot
       OUTPUT[1|3␤]
17:07
       diakopter
       rakudo: sub foo(:$y = 2, $x?){ say "$x"~"|"~"$y"}; foo(1, :y(3));
17:07
       exp_evalbot
       OUTPUT[1|3␤]
17:07
       diakopter
       yep; that's it.    (here's the error - expecting OUTPUT[|3␤])
17:07

       rakudo: sub foo($x?, :$y = 2){ say "$x"~"|"~"$y"}; foo(:y(3));
17:07
       exp_evalbot
       OUTPUT[|␤]

Reply via email to