5.19 return

It leaves the control-flow of the innermost function it is declared in, which has to be distinguished when local functions are involved:

functionf1() {functionf2() {return; }f2();expression;}

The return leaves local function f2, but not f1, meaning expression is still evaluated.

If return is used without a value expression, the typer ensures that the return type of the function it returns from is of Void. If it has a value expression, the typer unifies its type with the return type (explicitly given or inferred by previous return expressions) of the function it returns from.