Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / docs / ecma334 / 12.3.3.15.xml
1 <?xml version="1.0"?>
2 <clause number="12.3.3.15" title="Try-catch-finally statements">
3   <paragraph>Definite assignment analysis for a try-catch-finally statement of the form: <code_example><![CDATA[
4 try try-block   
5 catch(...) catch-block-1  
6 ...  
7 catch(...) catch-block-n  
8 finally finally-block  
9 ]]></code_example>is done as if the statement were a try-finally statement enclosing a try-catch statement: <code_example><![CDATA[
10 try {  
11    try try-block   
12    catch(...) catch-block-1  
13    ...  
14    catch(...) catch-block-n  
15 }  
16 finally finally-block  
17 ]]></code_example></paragraph>
18   <paragraph>
19     <example>[Example: The following example demonstrates how the different blocks of a try statement (<hyperlink>15.10</hyperlink>) affect definite assignment. <code_example><![CDATA[
20 class A  
21 {  
22    static void F() {  
23       int i, j;  
24       try {  
25          goto LABEL:  
26          // neither i nor j definitely assigned  
27          i = 1;  
28          // i definitely assigned  
29       }  
30       catch {  
31          // neither i nor j definitely assigned  
32          i = 3;  
33          // i definitely assigned  
34       }  
35       finally {  
36          // neither i nor j definitely assigned  
37          j = 5;  
38          // j definitely assigned  
39       }  
40       // i and j definitely assigned  
41       LABEL:  
42       // j definitely assigned  
43       
44    }  
45 }  
46 ]]></code_example>end example]</example>
47   </paragraph>
48 </clause>