Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
A further test for RT #112922.
  • Loading branch information
jnthn committed Jun 30, 2015
1 parent c286040 commit 6ad32a7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion S06-signature/optional.t
Expand Up @@ -3,7 +3,7 @@ use Test;

# L<S06/Optional parameters/>

plan 29;
plan 30;

sub opt1($p?) { defined($p) ?? $p !! 'undef'; }

Expand Down Expand Up @@ -130,6 +130,8 @@ eval-dies-ok 'sub opt($a = 1, $b) { }',
{
throws-like 'sub foo(Int $x = "omg") { }', X::Parameter::Default::TypeCheck,
'Catch impossible default types at compile time';
throws-like 'sub foo(Bool $b = sub { False }) {}', X::Parameter::Default::TypeCheck,
'Catch impossible default types at compile time (code object)';
}

# vim: ft=perl6

0 comments on commit 6ad32a7

Please sign in to comment.