# New Ticket Created by Patrick R. Michaud
# Please include the string: [perl #47794]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=47794 >
The :method flag on subs doesn't seem to work when
the :outer flag is present. Here's a test case:
.sub main
$P0 = newclass 'Foo'
$P9 = get_hll_global ['Foo'], 'abc'
$P9()
$P1 = new 'Foo'
$P1.'xyz'()
.end
.namespace ['Foo']
.sub abc
say 'abc'
.end
.sub xyz :outer('abc') :method
say 'xyz'
.end
$ ./parrot x.pir
abc
Method 'xyz' not found
current instr.: 'main' pc 21 (x.pir:8)
$
However, it does seem to work if one uses add_method
instead of the :method pragma:
$ cat y.pir
.sub main
$P0 = newclass 'Foo'
$P9 = get_hll_global ['Foo'], 'abc'
$P9()
$P9 = get_hll_global ['Foo'], 'xyz'
$P0.'add_method'('xyz', $P9)
$P1 = new 'Foo'
$P1.'xyz'()
.end
.namespace ['Foo']
.sub abc
say 'abc'
.end
.sub xyz :outer('abc')
.param pmc self
say 'xyz'
.end
$ ./parrot y.pir
abc
xyz
$
This isn't a super-huge priority at the moment... for the
time being we can simply have PCT not attach any :outer
flags to methods. But eventually we'll probably want to
have this working.
Thanks!
Pm