Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #41047] [BUG] :multi doesn't work with :outer

4 views
Skip to first unread message

Patrick R . Michaud

unread,
Dec 4, 2006, 2:32:28 PM12/4/06
to bugs-bi...@rt.perl.org
# New Ticket Created by Patrick R. Michaud
# Please include the string: [perl #41047]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=41047 >


It appears that the :multi pragma doesn't work if :outer is present.
Sample code:

$ cat x.pir
.sub main :main
new $P0, .String
assign $P0, 'arg0'
new $P1, .String
assign $P1, 'arg1'

$P99 = "foo"($P0)

$P99 = "foo"($P0, $P1)

$P99 = "bar"($P0)

$P99 = "bar"($P0, $P1)
.end


.sub "foo" :multi(_)
.param pmc x
print "foo(_) : "
say x
.return (x)
.end

.sub "foo" :multi(_,_)
.param pmc x
.param pmc y
print "foo(_,_): "
print x
print " "
say y
.return (y)
.end

.sub "bar" :outer("main") :multi(_)
.param pmc x
print "bar(_) : "
say x
.return (x)
.end

.sub "bar" :outer("main") :multi(_,_)
.param pmc x
.param pmc y
print "bar(_,_): "
print x
print " "
say y
.return (y)
.end
$ ./parrot x.pir
foo(_) : arg0
foo(_,_): arg0 arg1
Null PMC access in invoke()
current instr.: 'main' pc 44 (x.pir:11)
$

Pm

Matt Diephouse via RT

unread,
Dec 4, 2006, 3:15:33 PM12/4/06
to perl6-i...@perl.org
Fixed in r15971. The MMD code checks that the sub is a Sub PMC so it can get the signature. I
expanded the check to work with Closure PMCs as well.
0 new messages