[Mono-bugs] [Bug 36323][Wis] New - mcs incorrect CS0161 when using switch with return in while

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Sun, 5 Jan 2003 15:50:06 -0500 (EST)


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 japj@xs4all.nl.

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

--- shadow/36323	Sun Jan  5 15:50:06 2003
+++ shadow/36323.tmp.24469	Sun Jan  5 15:50:06 2003
@@ -0,0 +1,67 @@
+Bug#: 36323
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: japj@xs4all.nl               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs incorrect CS0161 when using switch with return in while
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+
+Steps to reproduce the problem:
+1. Try to compile the following example:
+class Test1
+{
+	public int Test()
+	{
+		int var1=0;
+		while(true)
+		{
+			switch (var1)
+			{
+				case 5:
+					return 10;
+				default:
+					var1++;
+					break;
+			}
+		}
+	}
+	
+	public static void Main()
+	{
+	
+	}
+}
+
+
+Actual Results:
+
+japj@debian:~/mono$ mcs test2.cs
+test2.cs(3) error CS0161: Not all code paths return a value
+Compilation failed: 1 error(s), 0 warnings
+
+
+Expected Results:
+
+Compilation to succeed
+
+How often does this happen? 
+Always
+
+Additional Information:
+
+I found this when trying to get janet compiling with mcs