Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Tweak a test the compiler got too clever for.
  • Loading branch information
jnthn committed Jun 30, 2015
1 parent f0e859a commit c1305ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion S06-signature/optional.t
Expand Up @@ -88,7 +88,8 @@ eval-dies-ok 'sub opt($a = 1, $b) { }',
sub opt-type1(Int $x?) { $x };
ok opt-type1() === Int,
'optional param with type constraints gets the right value';
sub opt-type2(Int $x = 'str') { }; #OK not used
my $default = 'str';
sub opt-type2(Int $x = $default) { }; #OK not used
dies-ok { EVAL('opt-type2()') }, 'default values are type-checked';
}

Expand Down

0 comments on commit c1305ef

Please sign in to comment.