[perl #130761] [OPTIMIZER] An if-block confuses &?ROUTINE to point at the wrong outer routine

[email protected] ("Christian Bartolomaeus via RT") Thu, 04 Apr 2019 22:59:38 -0700
Newsgroups perl.perl6.compiler
Message-ID <[email protected]>
Just for the record: This seems to work on the JVM backend:

$ ./perl6-j --optimize=3 -e 'sub f() { sub g() { if True { return &?ROUTINE.name } } }; say f()()'
g

I'm going to unfudge the test in S02-magicals/sub.t for rakudo.jvm.