[Mono-bugs] [Bug 36313][Nor] New - name resolution not ignoring inaccessible type

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Sun, 5 Jan 2003 03:45:40 -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 cdaly@locosoft.net.

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

--- shadow/36313	Sun Jan  5 03:45:40 2003
+++ shadow/36313.tmp.28343	Sun Jan  5 03:45:40 2003
@@ -0,0 +1,91 @@
+Bug#: 36313
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: cdaly@locosoft.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: name resolution not ignoring inaccessible type
+
+Please fill in this template when reporting a bug, unless you know what you are doing.
+Description of Problem:
+
+This is seen with mcs 0.17.  The comment in the test case below
+explains the problem.
+
+// The base class for N1.Foo.Foo2 should be N1.Bar2 - not N2.Bar.Bar2.
+// If the program prints "Success!!" then Foo2 has the correct base class.
+//
+// Note that N2.Bar.Bar2 should be considered first by the name
+// resolution process because it is inherited but because it is
+// private it is not accessible to N1.Foo.Foo2.
+
+public class Test
+{ 
+ public static void Main(string[] args)
+ {
+        N1.Foo.Foo2 foo2 = new N1.Foo.Foo2();
+        foo2.Talk();
+ }
+}
+
+namespace N1
+{
+    public class Foo : N2.Bar
+    {
+        public class Foo2 : Bar2
+        {
+        }
+    }
+
+    public class Bar2
+    {
+        public void Talk()
+        {
+            System.Console.WriteLine("Success!!");
+        }
+    }
+}
+namespace N2
+{
+    public class Bar
+    {
+        private class Bar2
+        {
+            public void Talk()
+            {
+                System.Console.WriteLine("Failure!!");
+            }
+        }
+    }
+}
+
+
+Steps to reproduce the problem:
+1. compile the test case above
+2. 
+3. 
+
+Actual Results:  compile error:
+
+Bug2.cs(22) error CS0060: Inconsistent accessibility: base class `N2.Bar+Bar2' is less accessible than class `N1.Foo.Foo2'
+Compilation failed: 1 error(s), 0 warnings
+
+
+Expected Results:   The program should compile correctly and
+print "Success!!" when run.
+
+
+How often does this happen? always
+
+
+Additional Information: