[Mono-bugs] [Bug 29373][Nor] New - definite assignment tracking with try/catch blocks
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
23 Aug 2002 15:22:15 -0000
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by lupus@ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=29373
--- shadow/29373 Fri Aug 23 11:22:15 2002
+++ shadow/29373.tmp.13157 Fri Aug 23 11:22:15 2002
@@ -0,0 +1,40 @@
+Bug#: 29373
+Product: Mono/MCS
+Version: unspecified
+OS: other
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: lupus@ximian.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: definite assignment tracking with try/catch blocks
+
+The following program doesn't compile with mcs ehile it does with csc. The
+error is:
+te.cs(16) error CS0165: Use of unassigned local variable `res'
+
+using System;
+public class Ex {
+ public static int Main () {
+ int res;
+ int a = Environment.NewLine.Length;
+ int fin = 0;
+ try {
+ res = 10/a;
+ throw new NotImplementedException ();
+ } catch (NotImplementedException e) {
+ fin = 2;
+ throw new NotImplementedException ();
+ } finally {
+ fin = 1;
+ }
+ return res;
+ }
+}