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


This one is a bit obscure... but it's a bit of a rakudo blocker
at the moment for adding listop parsing the way I'd like.

If a sub has both :optional and :slurpy :named arguments, it sometimes
"eats" the first named argument if called with :named :flat.

Here's an example:

$ cat x.pir
.sub main :main
    load_bytecode 'dumper.pbc'
    $P0 = newclass 'Foo'

    $P1 = new 'Foo'
    $P1.'abc'('one'=>1, 'two'=>2)

    $P2 = new 'Hash'
    $P2['one'] = 1
    $P2['two'] = 2

    $P1.'abc'($P2 :named :flat)
.end

.namespace ['Foo']
.sub 'abc' :method
    .param pmc value           :optional
    .param int has_value       :opt_flag
    .param pmc adverbs         :slurpy :named
    _dumper(adverbs, "abc")
.end

$ ./parrot x.pir
"abc" => Hash {
    "one" => 1,
    "two" => 2
}
"abc" => Hash {
    "one" => null,
    "two" => 2
}
$


This may also be related to RT#43231, which had a similar
problem in dealing with :optional and :slurpy :named both
appearing in the same sub.

Pm

Reply via email to