https://bugzilla.novell.com/show_bug.cgi?id=333891

           Summary: CS0122 error when accessing member hidden by non-
                    accessible member
           Product: Mono: Compilers
           Version: 1.2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: [EMAIL PROTECTED]
          Found By: ---


When a member of base class is "hidden" by a non-accessible member, then (g)mcs
reports CS0122 when the public member is referenced while it should ignore the
hiding member since it is not publicly accessible.

To reproduce, compile the following code:

using System;

class Program
{
        static int Main ()
        {
                B b = new B ();
                if (b.Message != "OK")
                        return 1;
                return 0;
        }
}

class A
{
        public virtual string Message {
                get {
                        return "OK";
                }
        }
}

class B : A
{
        new string Message {
                get {
                        throw new Exception ();
                }
        }
}

Expected result:

Successful compilation.

Actual result:

test.cs(8,21): error CS0122: `B.Message' is inaccessible due to its protection
 level


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to