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


Defining a .sub with both :optional (positional) and :slurpy :named
parameters results in an exception "invalid arg type in 
named portion of args" when called without the optional arg.

Example:

    $ cat x.pir
    .sub 'main' :main
        'foo'(123, 'xyz' => 'abc')
        'foo'('xyz' => 'abc')
    .end
    
    .sub 'foo'
        .param string posarg       :optional
        .param int    has_posarg   :opt_flag
        .param pmc    namedargs    :slurpy :named
        say posarg
        $S0 = namedargs['xyz']
        say $S0
        .return()
    .end
    
    $ ./parrot x.pir
    123
    abc
    invalid arg type in named portion of args
    current instr.: 'foo' pc 26 (x.pir:7)
    called from Sub 'main' pc 21 (x.pir:3)
    $
  
I've entered a (TODO) test for this into t/op/calling.t,
and will cite this RT# in the test (as soon as I have it).

Thanks!

Pm 

Reply via email to