Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add a test for RT #121426.
  • Loading branch information
jnthn committed Oct 6, 2015
1 parent c597341 commit 4e9eb58
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion S06-signature/types.t
@@ -1,13 +1,16 @@
use v6;
use Test;

plan 9;
plan 10;

sub f($x) returns Int { return $x };

ok &f.returns === Int, 'sub f returns Int can be queried for its return value';
ok &f.of === Int, 'sub f returns Int can be queried for its return value (.of)';

# RT #121426
ok &f ~~ Callable[Int], 'sub f ~~ Callable[Int]';

lives-ok { f(3) }, 'type check allows good return';
dies-ok { f('m') }, 'type check forbids bad return';

Expand Down

0 comments on commit 4e9eb58

Please sign in to comment.