Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add tests for dup parameter names including ::T
  • Loading branch information
TimToady committed Feb 26, 2015
1 parent 40180a9 commit 9c17759
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion S06-signature/positional.t
@@ -1,6 +1,6 @@
use v6;
use Test;
plan 7;
plan 13;

sub my_first ($x, $, $ ) { $x };
sub my_second ($, $x, $ ) { $x };
Expand Down Expand Up @@ -38,4 +38,11 @@ is my_third( 4, 5, 6), 6, '($, $, $x) works as a signature';
is dollar-slash(1, { b => 2 }, 3), '1 2 3', '$/ works as parameter name';
}

eval_dies_ok 'sub foo( $a, $a ) { }', 'two sub params with the same scalar name';
eval_dies_ok 'sub foo( @a, @a ) { }', 'two sub params with the same array name';
eval_dies_ok 'sub foo( %a, %a ) { }', 'two sub params with the same hash name';
eval_dies_ok 'sub foo( &a, &a ) { }', 'two sub params with the same callable name';
eval_dies_ok 'sub foo( \a, \a ) { }', 'two sub params with the same sigilles name';
eval_dies_ok 'sub foo( ::T, ::T) { }', 'two sub params with the same type capture name';

# vim: ft=perl6

0 comments on commit 9c17759

Please sign in to comment.