# 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.new␤Code.new␤»
rakudo-moar 186223: OUTPUT«sub foo () { #`(Sub|53058688) ...
}␤Code.new␤Code.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«3␤3␤0␤»
rakudo-moar 186223: OUTPUT«3␤3␤0␤»

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«3␤3␤3␤»
rakudo-moar 186223: OUTPUT«3␤3␤3␤»

I expect that the &?ROUTINE in the gather also points to the foo subroutine.

Reply via email to