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


Jonathan asked that I submit this as a reminder to him.

mod_perl6 is written in Perl 6 and relies heavily on classes defined in 
PIR.  However, when mod_perl6 is precompiled to PIR, those classes do 
not yet exist, and parser does not see the names as classes.  The result 
is that Foo.new() becomes:

     $P20 = "Foo"()
     $P21 = "!dispatch_method"($P20, "new")

with the out-of-place "Foo"() failing miserably.  The offending code can 
be easily reproduced using the pir target:

[j...@groovy rakudo]$ ./perl6 --target=pir
> Foo.new

.namespace []
.sub "_block11" :main :anon :subid("10_1240503611")
     .param pmc param_22 :slurpy
.annotate "line", 0
     .const 'Sub' $P24 = "12_1240503611"
     capture_lex $P24
     find_name $P13, "!UNIT_START"
.annotate "line", 1
     .const 'Sub' $P15 = "11_1240503611"
     .lex "@_", param_22
     .tailcall $P13($P15, param_22)
.annotate "line", 0
     .return ()
.end


.namespace []
.sub "" :load :init :subid("post13") :outer("10_1240503611")
.annotate "line", 0
     .const 'Sub' $P12 = "10_1240503611"
     .local pmc block
     set block, $P12
$P0 = compreg "Perl6"
unless null $P0 goto have_perl6
load_bytecode "perl6.pbc"
have_perl6:
.end


.namespace []
.sub "_block14"  :anon :subid("11_1240503611")
.annotate "line", 1
     get_namespace $P16
     .lex "$?PACKAGE", $P16
.include "interpinfo.pasm"
     new $P17, "Perl6Scalar"
     .lex "$_", $P17
     new $P18, "Perl6Scalar"
     .lex "$/", $P18
     new $P19, "Perl6Scalar"
     .lex "$!", $P19
     $P20 = "Foo"()
     $P21 = "!dispatch_method"($P20, "new")
     .return ($P21)
.end


.namespace []
.sub "_block23" :load :anon :subid("12_1240503611") 
:outer("10_1240503611")
.annotate "line", 0
.include "interpinfo.pasm"
$P0 = interpinfo .INTERPINFO_CURRENT_SUB
$P0 = $P0."get_outer"()
$P0()
     .return ()
.end

Reply via email to