[Mono-bugs] [Bug 24544] New - Return path analysis ignores switch fall-through
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
10 May 2002 23:12:04 -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 dihlewis@yahoo.co.uk.
http://bugzilla.ximian.com/show_bug.cgi?id=24544
--- shadow/24544 Fri May 10 19:12:04 2002
+++ shadow/24544.tmp.19819 Fri May 10 19:12:04 2002
@@ -0,0 +1,41 @@
+Bug#: 24544
+Product: Mono/MCS
+Version: unspecified
+OS: other
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: dihlewis@yahoo.co.uk
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Return path analysis ignores switch fall-through
+
+./test.cs(8) error CS0161: Not all code paths return a value
+Error: Compilation failed
+
+
+
+using System;
+
+class Test {
+ public static void Main () {
+ Foo (1);
+ }
+
+ static int Foo (int x) {
+ switch (x) {
+ case 1:
+ goto case 2;
+ case 2:
+ return 1;
+ default:
+ return 0;
+ }
+ }
+}