[Mono-bugs] [Bug 60095][Wis] New - mcs does not report CS0162 (in warn level 4)

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 12 Jun 2004 05:44:37 -0400 (EDT)


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 gert.driesen@pandora.be.

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

--- shadow/60095	2004-06-12 05:44:37.000000000 -0400
+++ shadow/60095.tmp.21735	2004-06-12 05:44:37.000000000 -0400
@@ -0,0 +1,40 @@
+Bug#: 60095
+Product: Mono: Compilers
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gert.driesen@pandora.be               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs does not report CS0162 (in warn level 4)
+
+mcs does not report CS0162 (unreachable code detected) for the following 
+code :
+
+using System;
+using System.Reflection;
+
+public class EntryPoint
+{
+	public static void Main ()
+	{
+		MethodAttributes ma = MethodAttributes.Public;
+		Console.WriteLine ("MA: " + ma.ToString ());
+
+		if ((ma & MethodAttributes.PrivateScope) != 0)
+			Console.WriteLine("private scope");
+	}
+}
+
+csc reports the following warning as the code in the if block can never 
+be executed :
+
+test.cs(12,4): warning CS0162: Unreachable code detected