[Mono-bugs] [Bug 62230][Wis] New - CS0050: conflicting class name resolution between local type and protected type in referenced libraries
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Sun, 1 Aug 2004 13:25:50 -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 atsushi@ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=62230
--- shadow/62230 2004-08-01 13:25:50.000000000 -0400
+++ shadow/62230.tmp.15010 2004-08-01 13:25:50.000000000 -0400
@@ -0,0 +1,78 @@
+Bug#: 62230
+Product: Mono: Compilers
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: C#
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: atsushi@ximian.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: CS0050: conflicting class name resolution between local type and protected type in referenced libraries
+
+mcs (and gmcs) handles ambiguous type name differently that can be either
+1) local class in the source file itself or 2) one of a protected class in
+any of the referenced libraries (or it might be just "any of other sources").
+
+In such case shown in the example code, csc takes precedence for 2)
+protected (external) type, while mcs takes 1) local class declaration.
+
+
+Steps to reproduce the problem:
+1. Save these two sources.
+
+---- cs0050p.cs ----
+public class BaseClass
+{
+ protected class InternalClass
+ {
+ }
+}
+
+---- cs0050c.cs ----
+public class Test : BaseClass
+{
+ public InternalClass foo ()
+ {
+ return null;
+ }
+}
+
+public class InternalClass
+{
+}
+
+
+2. compile cs0050p.cs into cs0050p.dll
+csc -t:library cs0050p.cs
+
+3. compile cs0050c.cs referencing cs0050p.dll
+csc -r:cs0050p.dll cs0050c.cs
+
+
+Results:
+mcs never complains CS0050, while csc does.
+
+$ mcs -r:cs0050p.dll cs0050c.cs
+error CS5001: Program cs0050c.exe does not have an entry point defined
+Compilation failed: 1 error(s), 0 warnings
+
+$ csc -r:cs0050p.dll cs0050c.cs -nologo
+cs0050c.cs(3,23): error CS0050: Inconsistent accessibility: return type
+ 'BaseClass.InternalClass' is less accessible than method 'Test.foo()'
+cs0050p.dll: (Location of symbol related to previous error)
+
+
+How often does this happen?
+- consistently.
+
+Additional Information:
+
+It never happens when you replace "protected" with "internal" or "private"
+in cs0050p.cs.