Table of Contents 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Notes DownloadECMA-334 C# Language Specification 12 Variables 12.3 Definite assignment 12.3.3 Precise rules for determining definite assignment
Paragraph 11 In order to determine that each used variable is definitely assigned, the compiler must use a process that is equivalent to the one described in this section.
Paragraph 21 The compiler processes the body of each function member that has one or more initially unassigned variables. 2 For each initially unassigned variable v, the compiler determines a definite assignment state for v at each of the following points in the function member:
8 The definite assignment state of v can be either:
- 3 At the beginning of each statement
- 4 At the end point (§15.1) of each statement
- 5 On each arc which transfers control to another statement or to the end point of a statement
- 6 At the beginning of each expression
- 7 At the end of each expression
Paragraph 31 The following rules govern how the state of a variable v is determined at each location.
- 9 Definitely assigned. 10 This indicates that on all possible control flows to this point, v has been assigned a value.
- 11 Not definitely assigned. 12 For the state of a variable at the end of an expression of type bool, the state of a variable that isn't definitely assigned may (but doesn't necessarily) fall into one of the following sub-states:
- 13 Definitely assigned after true expression. 14 This state indicates that v is definitely assigned if the boolean expression evaluated as true, but is not necessarily assigned if the boolean expression evaluated as false.
- 15 Definitely assigned after false expression. 16 This state indicates that v is definitely assigned if the boolean expression evaluated as false, but is not necessarily assigned if the boolean expression evaluated as true.
|Jagger Software Ltd|
|Company # 4070126|
|VAT # 762 5213 42|