NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

8.9.4 The return statement

The return statement returns control to the caller of the function member in which the return statement appears.

return-statement:
return expressionopt ;

A return statement with no expression can be used only in a function member that does not compute a value, that is, a method with the return type void, the set accessor of a property or indexer, a constructor, or a destructor.

A return statement with an expression can only be used only in a function member that computes a value, that is, a method with a non-void return type, the get accessor of a property or indexer, or a user-defined operator. An implicit conversion (§6.1) must exist from the type of the expression to the return type of the containing function member.

It is an error for a return statement to appear in a finally block (§8.10).

A return statement is executed as follows:

Because a return statement unconditionally transfers control elsewhere, the end point of a return statement is never reachable.