Skip to content

Commit

Permalink
cannot use Inf index to assign or access element in infinite array, R…
Browse files Browse the repository at this point in the history
…T #73184
  • Loading branch information
bbkr committed Jul 15, 2012
1 parent c1c897c commit 4d39751
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion S02-types/array.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 91;
plan 93;

#L<S02/Mutable types/Array>

Expand Down Expand Up @@ -335,6 +335,15 @@ my @array2 = ("test", 1, Mu);
ok Array(1,2,3) eqv [1,2,3], 'Array(1,2,3) makes correct array';
}

# RT 73184
{
my @a = 0..*;
try { @a[ Inf ] = 3 };
ok "$!" ~~ /'type cannot unbox to a native integer'/, 'cannot use Inf index to assign element in infinite array';
try { @a[ Inf ].say };
ok "$!" ~~ /'type cannot unbox to a native integer'/, 'cannot use Inf index to access element in infinite array';
}

done;

# vim: ft=perl6

0 comments on commit 4d39751

Please sign in to comment.