[Mono-bugs] [Bug 36155][Nor] New - Flow analysis bug with loops/breaks.
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
29 Dec 2002 08:33:03 -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 miguel@ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=36155
--- shadow/36155 Sun Dec 29 03:33:03 2002
+++ shadow/36155.tmp.7487 Sun Dec 29 03:33:03 2002
@@ -0,0 +1,51 @@
+Bug#: 36155
+Product: Mono/MCS
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Misc
+AssignedTo: martin@gnome.org
+ReportedBy: miguel@ximian.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Flow analysis bug with loops/breaks.
+
+Hello!
+
+ The following program fails to compile:
+
+using System;
+
+class XX {
+ static bool t= false;
+
+ static int Loop (int x)
+ {
+ while (true){
+ if (t)
+ return 1;
+
+ switch (x){
+ case 1:
+ break;
+ }
+
+ }
+ }
+
+ static void Main ()
+ {
+ int a = Loop (10);
+ }
+}
+
+Because there is a `break' statement inside the switch statement inside the
+while statement, here is the error:
+
+a.cs(6) error CS0161: Not all code paths return a value