<?xml version="1.0"?>
<clause number="15.9.4" title="The return statement">
  <paragraph>The return statement returns control to the caller of the function member in which the return statement appears. <grammar_production><name><non_terminal where="15.9.4">return-statement</non_terminal></name> : <rhs><keyword>return</keyword><non_terminal where="14.14">expression</non_terminal><opt/><terminal>;</terminal></rhs></grammar_production></paragraph>
  <paragraph>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 <keyword>void</keyword>, the set accessor of a property or indexer, the add and remove accessors of an event, an instance constructor, static constructor, or a destructor. </paragraph>
  <paragraph>A return statement with an expression can only be used 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 (<hyperlink>13.1</hyperlink>) must exist from the type of the expression to the return type of the containing function member. </paragraph>
  <paragraph>It is a compile-time error for a return statement to appear in a finally block (<hyperlink>15.10</hyperlink>). </paragraph>
  <paragraph>A return statement is executed as follows: <list><list_item> If the return statement specifies an expression, the expression is evaluated and the resulting value is converted to the return type of the containing function member by an implicit conversion. The result of the conversion becomes the value returned to the caller. </list_item><list_item> If the return statement is enclosed by one or more try blocks with associated finally blocks, control is initially transferred to the finally block of the innermost try statement. When and if control reaches the end point of a finally block, control is transferred to the finally block of the next enclosing try statement. This process is repeated until the finally blocks of all enclosing try statements have been executed. </list_item><list_item> Control is returned to the caller of the containing function member. </list_item></list></paragraph>
  <paragraph>Because a return statement unconditionally transfers control elsewhere, the end point of a return statement is never reachable. </paragraph>
</clause>
