Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

&?ROUTINE changes to something else in gather in for loop #4493

Open
p6rt opened this issue Aug 28, 2015 · 3 comments
Open

&?ROUTINE changes to something else in gather in for loop #4493

p6rt opened this issue Aug 28, 2015 · 3 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Aug 28, 2015

Migrated from rt.perl.org#125934 (status was 'open')

Searchable as RT125934$

@p6rt
Copy link
Author

p6rt commented Aug 28, 2015

From @FROGGS

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.

@p6rt
Copy link
Author

p6rt commented Dec 3, 2017

From @AlexDaniel

Still reproducible (2017.11,HEAD(e5b660e))

On 2015-08-28 10​:05​:31, FROGGS.de wrote​:

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.

@p6rt
Copy link
Author

p6rt commented Dec 3, 2017

The RT System itself - Status changed from 'new' to 'open'

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant