Skip Menu |
Report information
Id: 125659
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: masak <cmasak [at] gmail.com>
Cc:
AdminCc:

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



To: rakudobug [...] perl.org
Subject: [BUG] Internal error when doing $::<a> in Rakudo
From: Carl Mäsak <cmasak [...] gmail.com>
Date: Tue, 21 Jul 2015 13:59:45 +0200
Download (untitled) / with headers
text/plain 973b
<jaffa4> m: class m { has $.a; method m1() { $::<!a"> = 1; } } ; my $c = m.new(); $c.m1(); <camelia> rakudo-moar 27f88c: OUTPUT«===SORRY!===␤MVMArray: Index out of bounds␤» <ShimmerFairy> m: my $a; ::<$a> = 5; say $a <camelia> rakudo-moar 27f88c: OUTPUT«5␤» <ShimmerFairy> m: my $a; $::<a> = 5; say $a <camelia> rakudo-moar 27f88c: OUTPUT«===SORRY!===␤MVMArray: Index out of bounds␤» <FROGGS> ShimmerFairy: yeah, should probably do the same as $::("a") <ShimmerFairy> m: my $a; $::{"a"} = 5; say $a # also broken, at least to me <camelia> rakudo-moar 27f88c: OUTPUT«===SORRY!===␤MVMArray: Index out of bounds␤» <masak> m: $::<a> <camelia> rakudo-moar 27f88c: OUTPUT«===SORRY!===␤MVMArray: Index out of bounds␤» * masak submits rakudobug Whether the $a exists in the scope or not, the "Index out of bounds" error arguably shouldn't occur in either of those cases. It's OK for the lookup to fail, but preferably in a more explanatory way.
Still reproducible (2017.11,HEAD(e5b660e)), but now it prints a different message:

Show quoted text
===SORRY!=== Error while compiling -e
Variable '$' is not declared
at -e:1
------> my $a; ⏏$::<a> = 5; say $a



On 2015-07-21 04:59:56, masak wrote:
Show quoted text
> <jaffa4> m: class m { has $.a; method m1() { $::<!a"> = 1; } }
> ; my $c = m.new(); $c.m1();
> <camelia> rakudo-moar 27f88c: OUTPUT«===SORRY!===␤MVMArray: Index out
> of bounds␤»
> <ShimmerFairy> m: my $a; ::<$a> = 5; say $a
> <camelia> rakudo-moar 27f88c: OUTPUT«5␤»
> <ShimmerFairy> m: my $a; $::<a> = 5; say $a
> <camelia> rakudo-moar 27f88c: OUTPUT«===SORRY!===␤MVMArray: Index out
> of bounds␤»
> <FROGGS> ShimmerFairy: yeah, should probably do the same as $::("a")
> <ShimmerFairy> m: my $a; $::{"a"} = 5; say $a # also broken, at least to me
> <camelia> rakudo-moar 27f88c: OUTPUT«===SORRY!===␤MVMArray: Index out
> of bounds␤»
> <masak> m: $::<a>
> <camelia> rakudo-moar 27f88c: OUTPUT«===SORRY!===␤MVMArray: Index out
> of bounds␤»
> * masak submits rakudobug
>
> Whether the $a exists in the scope or not, the "Index out of bounds"
> error arguably shouldn't occur in either of those cases. It's OK for
> the lookup to fail, but preferably in a more explanatory way.




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

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