X hits on this document

843 views

0 shares

0 downloads

0 comments

105 / 396

C# LANGUAGE SPECIFICATION

finally { // neither i nor j definitely assigned j = 5; // j definitely assigned } // i and j definitely assigned  LABEL:; // j definitely assigned } }

5.3.3.16 Foreach statements

For a foreach statement stmt of the form:

foreach ( type identifier in expr ) embedded-statement

The definite assignment state of v at the beginning of expr is the same as the state of v at the beginning of stmt.

The definite assignment state of v on the control flow transfer to embedded-statement or to the end point of stmt is the same as the state of v at the end of expr.

5.3.3.17 Using statements

For a using statement stmt of the form:

using ( resource-acquisition ) embedded-statement

The definite assignment state of v at the beginning of resource-acquisition is the same as the state of v at the beginning of stmt.

The definite assignment state of v on the control flow transfer to embedded-statement is the same as the state of v at the end of resource-acquisition.

5.3.3.18 Lock statements

For a lock statement stmt of the form:

lock ( expr ) embedded-statement

The definite assignment state of v at the beginning of expr is the same as the state of v at the beginning of stmt.

The definite assignment state of v on the control flow transfer to embedded-statement is the same as the state of v at the end of expr.

5.3.3.19 General rules for simple expressions

The following rule applies to these kinds of expressions: literals (§‎7.5.1), simple names (§‎7.5.2), member access expressions (§‎7.5.4), non-indexed base access expressions (§‎7.5.8), and typeof expressions (§‎7.5.11).

The definite assignment state of v at the end of such an expression is the same as the definite assignment state of v at the beginning of the expression.

5.3.3.20 General rules for expressions with embedded expressions

The following rules apply to these kinds of expressions: parenthesized expressions (§‎7.5.3), element access expressions (§‎7.5.6), base access expressions with indexing (§‎7.5.8), increment and decrement expressions (§‎7.5.9, §‎7.6.5), cast expressions (§‎7.6.6), unary +, -, ~, * expressions, binary +, -, *, /, %, <<, >>, <, <=, >, >=, ==, !=, is, as, &, |, ^ expressions (§‎7.7, §‎7.8, §‎7.9, §‎7.10), compound assignment expressions (§‎7.13.2), checked

92Copyright Microsoft Corporation 1999-2003. All Rights Reserved.

Document info
Document views843
Page views843
Page last viewedSun Dec 04 20:32:02 UTC 2016
Pages396
Paragraphs9401
Words133190

Comments