Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
name the exception on failed return type checks
  • Loading branch information
gfldex committed Aug 31, 2016
1 parent 07f48e2 commit 1104dc2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion doc/Language/control.pod6
Expand Up @@ -665,7 +665,14 @@ All these forms may produce a return value the same way C<loop> does.
=head1 X<return|control flow>
The routine C<return> will stop execution of a subroutine or method, run all relevant L<phasers|/language/phasers#Block_Phasers> and provide the given return value to the caller. The default return value is C<Nil>. If a return L<type constraint|/type/Signature#Constraining_Return_Types> is provided it will be checked unless the return value is C<Nil>. A control exception is raised and can be caught with L<CONTROL|/language/phasers#CONTROL>.
The routine C<return> will stop execution of a subroutine or method, run all
relevant L<phasers|/language/phasers#Block_Phasers> and provide the given
return value to the caller. The default return value is C<Nil>. If a return
L<type constraint|/type/Signature#Constraining_Return_Types> is provided it
will be checked unless the return value is C<Nil>. If the type check fails the
exception L<X::TypeCheck::Return|/type/X::TypeCheck::Return> is thrown. If it
passes a control exception is raised and can be caught with
L<CONTROL|/language/phasers#CONTROL>.
=comment TODO add link to section in /language/function that shows how return values are produces/handled
Expand Down

0 comments on commit 1104dc2

Please sign in to comment.