File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -195,10 +195,13 @@ the signature after the argument name.
195
195
The token C < -- > > followed by a type will force a type check on successful
196
196
execution of a routine. The return type arrow has to be placed at the end of
197
197
the parameter list. The keyword C < returns > following a signature declaration
198
- has the same function. C < Nil > is considered as being defined for the type check.
198
+ has the same function. C < Nil > is considered as being defined for the type
199
+ check. Type objects and thus undefined values will pass the test unless the
200
+ type smiley C < :D > is used.
199
201
200
202
201
- sub foo(--> Int) { 1 };
203
+ sub foo(--> Int) { my Int $i; $i };
204
+ sub foo(--> Int:D) { 1 }
202
205
sub foo() returns Int { 1 };
203
206
sub does-not-work(--> Int) { "" }; # throws X::TypeCheck::Return
204
207
You can’t perform that action at this time.
0 commit comments