Skip to content

Commit

Permalink
RT #125571: splice should not allow to sneak in values that violate t…
Browse files Browse the repository at this point in the history
…he type constraint of an array
  • Loading branch information
moritz committed Jul 22, 2015
1 parent 7502f61 commit 233c86e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion S32-array/splice.t
Expand Up @@ -45,7 +45,7 @@ my @testing =
# $@Num, Array[Num], # need way to handle named params in capture
;

plan (@testing/2 * 50) + 3 + 1 + 1;
plan (@testing/2 * 50) + 3 + 1 + 1 + 2;

for @testing -> @a, $T {
my $toNum = @a.of ~~ Num;
Expand Down Expand Up @@ -217,4 +217,11 @@ for @testing -> @a, $T {
is $i, 0, "'while (…splice…)' should neither hang nor even run";
} #1

# RT #125571
{
my Int @a = 1, 2, 3;
dies-ok { splice @a, 1, 1, 'not an integer'}, '&splice is type-safe';
dies-ok { @a.splice(1, 1, 'not an integer')}, '.splice is type-safe';
} #2

# vim: ft=perl6

0 comments on commit 233c86e

Please sign in to comment.