13.07.2015 Views

C# Language Specification - Willy .Net

C# Language Specification - Willy .Net

C# Language Specification - Willy .Net

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>C#</strong> LANGUAGE SPECIFICATION}}end example]finally {// neither i nor j definitely assignedj = 5;// j definitely assigned}// i and j definitely assignedLABEL:;// j definitely assigned12.3.3.16 Foreach statementsFor 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 thebeginning of stmt.• The definite assignment state of v on the control flow transfer to embedded-statement or to the endpoint of stmt is the same as the state of v at the end of expr.12.3.3.17 Using statementsFor 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 ofv at the beginning of stmt.• The definite assignment state of v on the control flow transfer to embedded-statement is the same asthe state of v at the end of resource-acquisition.12.3.3.18 Lock statementsFor 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 thebeginning of stmt.• The definite assignment state of v on the control flow transfer to embedded-statement is the same asthe state of v at the end of expr.12.3.3.19 General rules for simple expressionsThe following rule applies to these kinds of expressions: literals (§14.5.1), simple names (§14.5.2), memberaccess expressions (§14.5.4), non-indexed base access expressions (§14.5.8), and typeof expressions(§14.5.11).• The definite assignment state of v at the end of such an expression is the same as the definiteassignment state of v at the beginning of the expression.12.3.3.20 General rules for expressions with embedded expressionsThe following rules apply to these kinds of expressions: parenthesized expressions (§14.5.3), element accessexpressions (§14.5.6), base access expressions with indexing (§14.5.8), increment and decrementexpressions (§14.5.9, §14.6.5), cast expressions (§14.6.6), unary +, -, ~, * expressions, binary +, -, *, /, %,, =, ==, !=, is, as, &, |, ^ expressions (§14.7, §14.8, §14.9, §14.10), compound108

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!