# New Ticket Created by "mhelix"
# Please include the string: [perl #58030]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=58030 >
Passing PMCs as named arguments fails when the called sub accepts optional
positional
arguments unless all optional arguments are passed. On my tests this bug only
affected PMC arguments. Passing an int, float or string works flawlessly.
Code that shows the problem:
.sub main :main
load_bytecode 'dumper.pbc'
'foo'('works flawlessly' :named('key'))
$P0 = new 'String'
$P0 = "it won't work now"
'foo'($P0 :named('key')) # Fails. Key is 'null'
.end
.sub 'foo'
.param pmc unused :optional
.param int has_unused :opt_flag
.param pmc key :named('key')
'_dumper' (key, 'key')
.end
The output is
"key" => "works flawlessly"
"key" => null