develooper Front page | perl.perl6.compiler | Postings from February 2018

[perl #126312] [BUG] `for @a` is not creating containers foruninitialized elements

From:
Jan-Olof Hendig via RT
Date:
February 6, 2018 22:13
Subject:
[perl #126312] [BUG] `for @a` is not creating containers foruninitialized elements
Message ID:
rt-4.0.24-19619-1517955176-1736.126312-80-0@perl.org
On Sat, 07 May 2016 13:26:09 -0700, smls75@gmail.com wrote:
> Confirmed on current Rakudo.
> 
> Interestingly, it works if `for @a` is replaced with `for @a[*]`:
> 
>     ➜  my Int @a;  @a[5] = 42;   $_ = 100 for @a[*];  say @a;
>     [100 100 100 100 100 100]

Seems to have been fixed with Rakudo commit 069b789af545dff30d450618fae82ccb82579346.
Tests needed.




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About