Skip Menu |
Report information
Id: 131945
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: cpan [at]

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)

Subject: [LTA] Differring behaviours when using an outer-scope-declared var before declaring it in current scope
Download (untitled) / with headers
text/plain 801b
I'd expect all three have the same behaviour (likely the last one, that cries about already-bound symbols): my int $x = 42; { say $x; my int $x = 70; } # OUTPUT: 0 (no errors) my int $y = 42; { say $y; my $y = 70; } # OUTPUT: # ===SORRY!=== # Cannot take a reference to a non-native lexical my $z = 42; { say $z; my $z = 70; } # ===SORRY!=== Error while compiling /home/zoffix/devbox/tmp/C/exercises/f.p6 # Lexical symbol '$z' is already bound to an outer symbol; # the implicit outer binding must be rewritten as OUTER::<$z> # before you can unambiguously declare a new '$z' in this scope # at /home/zoffix/devbox/tmp/C/exercises/f.p6:12 # ------> { say $z; my $z⏏ = 70; } # expecting any of: # constraint
Download (untitled) / with headers
text/plain 109b
$ perl6 -v This is Rakudo version 2017.07-22-g02667bd built on MoarVM version 2017.07 implementing Perl 6.c.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at