Skip to content

Commit

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

# L<S06/Optional parameters/>

plan 28;
plan 29;

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

Expand Down Expand Up @@ -126,4 +126,10 @@ eval-dies-ok 'sub opt($a = 1, $b) { }',
'making an "is rw" parameter optional dies with adequate error message';
}

# RT #112922
{
throws-like 'sub foo(Int $x = "omg") { }', X::Parameter::Default::TypeCheck,
'Catch impossible default types at compile time';
}

# vim: ft=perl6

0 comments on commit c286040

Please sign in to comment.