[Mono-bugs] [Bug 64812][Nor] New - mcs does not detect compilation error...
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Tue, 31 Aug 2004 06:16:31 -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 banil@novell.com.
http://bugzilla.ximian.com/show_bug.cgi?id=64812
--- shadow/64812 2004-08-31 06:16:31.000000000 -0400
+++ shadow/64812.tmp.22540 2004-08-31 06:16:31.000000000 -0400
@@ -0,0 +1,74 @@
+Bug#: 64812
+Product: Mono: Compilers
+Version: unspecified
+OS:
+OS Details: RH Linux and Windows XP
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: banil@novell.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Summary: mcs does not detect compilation error...
+
+Description of Problem:
+Following test program compiles with mcs but appropriate compilation error
+are given by csc on .NET. Line numbers are given for reference. See
+Additional Information for details on version of mcs, csc, etc...
+
+01: using System;
+02:
+03: namespace Understanding_Protected
+04: {
+05: /// <summary>
+06: /// Summary description for Test.
+07: /// </summary>
+08: class Test
+09: {
+10: protected const int SOME_CONST_VALUE = -1;
+11:
+12: /// <summary>
+13: /// The main entry point for the application.
+14: /// </summary>
+15: [STAThread]
+16: static void Main(string[] args)
+17: {
+18: //
+19: // TODO: Add code to start application here
+20: //
+21: }
+22: }
+23:
+24: public enum MyEnum
+25: {
+26: TYPE_UNKNOWN = Test.SOME_CONST_VALUE
+27: }
+28: }
+
+Steps to reproduce the problem:
+1. compile the test code with mcs on Linux/Windows
+2. compile the test code with csc/VC.NET IDE on Windows
+
+
+Actual Results:
+If this is compiled using mcs on Linux or Windows XP, the compilation error
+goes undetected and the assembly is generated. It even runs properly.
+
+Expected Results:
+mcs should catch the compilation error. .NET C# compiler gives the
+following error message:
+Test.cs(26,18): error CS0122:
+'Understanding_Protected.Test.SOME_CONST_VALUE' is inaccessible due to its
+protection level
+
+How often does this happen?
+Always
+
+Additional Information:
+mcs version 1.0.1.0 on Windows XP
+mcs version 1.1.1.0 on RH Linux
+.NET C# version 7.10.3052.4