[Mono-bugs] [Bug 75433][Nor] New - CS0139 required when continue statement has no enclosing loop

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Jul 1 02:54:32 EDT 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 atsushi at ximian.com.

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

--- shadow/75433	2005-07-01 02:54:32.000000000 -0400
+++ shadow/75433.tmp.10072	2005-07-01 02:54:32.000000000 -0400
@@ -0,0 +1,52 @@
+Bug#: 75433
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: atsushi at ximian.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: CS0139 required when continue statement has no enclosing loop
+
+mcs does not report CS0139 error for "continue" statement that is not
+enclosed in a loop.
+
+
+public class Test
+{
+        public static void Foo (char c)
+        {
+                switch (char.GetUnicodeCategory (c)) {
+                default:
+                        if (c == 'a')
+                                continue;
+                        System.Console.WriteLine ();
+                        break;
+                }
+        }
+}
+
+Actual Results:
+no compilation error (except for CS5001 Main() not found).
+
+Expected Results:
+
+$ csc continue-without-loop.cs -nologo
+continue-without-loop.cs(8,5): error CS0139: No enclosing loop out of which to
+        break or continue
+
+How often does this happen? 
+consistently.
+
+Additional Information:
+
+At first I thought it is caused by some kind of optimization, but the
+example code above won't result in optimization (am not so sure though).


More information about the mono-bugs mailing list