[Mono-bugs] [Bug 76632][Nor] New - exception/finally problem.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Nov 4 14:31:16 EST 2005


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 toshok at ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=76632

--- shadow/76632	2005-11-04 14:31:16.000000000 -0500
+++ shadow/76632.tmp.3204	2005-11-04 14:31:16.000000000 -0500
@@ -0,0 +1,45 @@
+Bug#: 76632
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: toshok at ximian.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: exception/finally problem.
+
+The following test fails to compile on both mcs and gmcs:
+
+-----
+
+using System;
+
+public class Foo {
+  public static void Main (string[] args)
+  {
+    throw new Exception ();
+    string hi;
+    try { }
+    finally {
+      Console.WriteLine ("hi = {0}", hi);
+    }
+  }
+}
+
+-----
+
+the compilers spit out:
+
+toshok at linux:~> mcs foo.cs
+warning CS0162: Unreachable code detected
+foo.cs(10,9): warning CS0162: Unreachable code detected
+foo.cs(13,38): error CS0165: Use of unassigned local variable `hi'
+Compilation failed: 1 error(s), 2 warnings


More information about the mono-bugs mailing list