We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fca20a4 commit d886c58Copy full SHA for d886c58
S06-signature/types.t
@@ -3,17 +3,18 @@ use Test;
3
4
plan 6;
5
6
-sub f returns Int ($x) { return $x };
+sub f($x) returns Int { return $x };
7
8
ok &f.returns === Int, 'sub f returns Int can be queried for its return value';
9
ok &f.of === Int, 'sub f returns Int can be queried for its return value (.of)';
10
11
lives_ok { f(3) }, 'type check allows good return';
12
dies_ok { f('m') }, 'type check forbids bad return';
13
14
-sub g returns Int ($x) { $x };
+sub g($x) returns Int { $x };
15
16
lives_ok { g(3) }, 'type check allows good implicit return';
17
+#?rakudo todo 'type check on return value'
18
dies_ok { g('m') }, 'type check forbids bad implicitreturn';
19
20
# vim: ft=perl6
0 commit comments