disable broken tests on net_4_0
[mcs.git] / docs / ecma334 / 12.3.3.23.xml
blobf783d1adac21469f1fc77bab152f4288589af5e1
1 <?xml version="1.0"?>
2 <clause number="12.3.3.23" title="&amp;&amp; expressions">
3   <paragraph>For an expression expr of the form expr-first &amp;&amp; expr-second: <list><list_item> The definite assignment state of v before expr-first is the same as the definite assignment state of v before expr. </list_item><list_item> The definite assignment state of v before expr-second is definitely assigned if the state of v after expr-first is either definitely assigned or &quot;definitely assigned after true expression&quot;. Otherwise, it is not definitely assigned. </list_item><list_item> The definite assignment state of v after expr is determined by: </list_item><list><list_item> If the state of v after expr-first is definitely assigned, then the state of v after expr is definitely assigned. </list_item><list_item> Otherwise, if the state of v after expr-second is definitely assigned, and the state of v after expr-first is &quot;definitely assigned after false expression&quot;, then the state of v after expr is definitely assigned. </list_item><list_item> Otherwise, if the state of v after expr-second is definitely assigned or &quot;definitely assigned after true expression&quot;, then the state of v after expr is &quot;definitely assigned after true expression&quot;. </list_item><list_item> Otherwise, if the state of v after expr-first is &quot;definitely assigned after false expression&quot;, and the state of v after expr-second is &quot;definitely assigned after false expression&quot;, then the state of v after expr is &quot;definitely assigned after false expression&quot;. </list_item><list_item> Otherwise, the state of v after expr is not definitely assigned. </list_item></list></list></paragraph>
4   <paragraph>
5     <example>[Example: In the example <code_example><![CDATA[
6 class A  
7 {  
8    static void F(int x, int y) {  
9       int i;  
10       if (x >= 0 && (i = y) >= 0) {  
11          // i definitely assigned  
12       }  
13       else {  
14          // i not definitely assigned  
15       }  
16       // i not definitely assigned  
17    }  
18 }  
19 ]]></code_example>the variable i is considered definitely assigned in one of the embedded statements of an if statement but not in the other. In the if statement in method F, the variable i is definitely assigned in the first embedded statement because execution of the expression (i = y) always precedes execution of this embedded statement. In contrast, the variable i is not definitely assigned in the second embedded statement, since x &gt;= 0 might have tested false, resulting in the variable i's being unassigned. end example]</example>
20   </paragraph>
21 </clause>