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 5f8fb85 commit 417fbfeCopy full SHA for 417fbfe
doc/Language/functions.pod6
@@ -187,6 +187,12 @@ Attempting to return values of another type will cause a compilation error.
187
188
sub foo() returns Int { "a"; }; foo; # Type check fails
189
190
+Note that C<Nil> and C<Failure> are excempt from return type constraints and
191
+can be returned from any routine, regardless of its constraint:
192
+
193
+ sub foo() returns Int { fail }; foo; # Failure returned
194
+ sub foo() returns Int { return }; foo; # Nil returned
195
196
=head2 X<Multi-dispatch|declarator,multi>
197
198
Perl 6 allows you to write several routines with the same name, but different
0 commit comments