# New Ticket Created by Tobias Leich
# Please include the string: [perl #125934]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=125934 >
m: sub foo { say &?ROUTINE.perl; gather for 1 { say &?ROUTINE.perl; };
gather for 1 { say &?ROUTINE.perl; } }; foo
rakudo-moar 5fb81f: OUTPUT«sub foo () { #`(Sub|59748232) ...
}Code.newCode.new»
rakudo-moar 186223: OUTPUT«sub foo () { #`(Sub|53058688) ...
}Code.newCode.new»
m: sub foo { say &?ROUTINE.perl; for 1 { say &?ROUTINE.perl; }; gather
for 1 { say &?ROUTINE.perl; } }; foo
rakudo-moar 5fb81f: OUTPUT«sub foo () { #`(Sub|42434376) ... }sub foo
() { #`(Sub|42434376) ... }Code.new»
rakudo-moar 186223: OUTPUT«sub foo () { #`(Sub|54308288) ... }sub foo
() { #`(Sub|54308288) ... }Code.new»
m: sub foo($,$,$) { say &?ROUTINE.arity; for 1 { say &?ROUTINE.arity; };
gather for 1 { say &?ROUTINE.arity; } }; foo 1, 2, 3
rakudo-moar 5fb81f: OUTPUT«330»
rakudo-moar 186223: OUTPUT«330»
m: sub foo($,$,$) { say &?ROUTINE.arity; for 1 { say &?ROUTINE.arity; };
gather for 1 { if 1 { say &?ROUTINE.arity } } }; foo 1, 2, 3
rakudo-moar 5fb81f: OUTPUT«333»
rakudo-moar 186223: OUTPUT«333»
I expect that the &?ROUTINE in the gather also points to the foo subroutine.