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

warning-less sub closure over a variable declared later in same scope #6246

Open
p6rt opened this issue May 13, 2017 · 1 comment
Open

warning-less sub closure over a variable declared later in same scope #6246

p6rt opened this issue May 13, 2017 · 1 comment

Comments

@p6rt
Copy link

p6rt commented May 13, 2017

Migrated from rt.perl.org#131307 (status was 'new')

Searchable as RT131307$

@p6rt
Copy link
Author

p6rt commented May 13, 2017

From @zoffixznet

https://irclog.perlgeek.de/perl6-dev/2017-05-13#i_14576917

16​:35 Zoffix m​: my $x = 72; { sub foo { say $x }; foo ; my $x = 42; say $x }
16​:35 camelia rakudo-moar 83b7ac​: OUTPUT​: «(Any)␤42␤»
16​:37 TimToady should probably get the "already bound to outer symbol" warning
16​:37 m​: my $x = 72; { say $x; my $x = 42; say $x }
16​:37 camelia rakudo-moar 83b7ac​: OUTPUT​: «5===SORRY!5=== Error while compiling <tmp>␤Lexical symbol '$x' is already bound to an outer symbol;␤the implicit outer binding must be rewritten as OUTER​::<$x>␤before you can unambiguously declare a new '$x' in this scope␤at <tmp>​:1␤------>…»
16​:38 TimToady like that one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant