Permalink
Browse files

[t/spec] tests for RT #67558

git-svn-id: http://svn.pugscode.org/pugs@30124 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent 778dcff commit 94cbe700dbf419ee80eea1bedcce9e72ea0cc343 moritz committed Mar 18, 2010
Showing with 12 additions and 0 deletions.
  1. +12 −0 S06-signature/named-parameters.t
@@ -257,6 +257,18 @@ eval_dies_ok 'sub svn28865( :$a, :@a ) {}',
ok $t ~~ /b.*c/, '$b was bound before $c';
}
+# RT #67558
+{
+ eval_dies_ok q[sub a(:$x, :foo($x) = $x) { $x }],
+ 'Cannot rename a parameter to an already existing positional';
+ sub a(:$x, :foo($y) = $x) { $y };
+ is a(x => 2), 2, 'Can fill named parameter with default from other named';
+ is a(foo => 3), 3, 'Can fill in directly even it has a default value';
+ is a(x => 2, foo => 3), 3, 'direct fill takes precedence';
+
+
+}
+
done_testing;
# vim: ft=perl6

0 comments on commit 94cbe70

Please sign in to comment.