return
Use return to exit the current function.
Full reference: flow return.
Notes#
- Supported forms + diagnostics: flow return
Syntax#
return;
return expr;
Example#
fn add1 (x: int) -> int {
return x + 1;
}
fn main () -> int {
return add1(41);
}
See also#
- Full reference: flow return
testblocks allowreturn;: testing
Source repository · Edit this page · View Markdown