Bug 28022

Summary: Mono C# compiler incorrectly emits error CS0053 when using protected internal members in a derived class that is nested inside another class
Product: [Mono] Compilers Reporter: emoriarty
Component: C#Assignee: Marek Safar <masafa>
Status: RESOLVED FIXED    
Severity: normal CC: mono-bugs+mono, sig-rnd-sat-mono-bugs
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Tags: Is this bug a regression?: ---
Last known good build:

Description emoriarty 2015-03-13 17:04:34 UTC
The mono C# compiler incorrectly emits CS0053 when using protected internal members inside a derived class that is nested inside another class.

---------------
$ cat Test.cs 
---------------
public class A
{
    protected internal struct C { }
}
class B
{
    class D : A
    {
        public A.C Property { get; set; }
    }
}

-----------------------------------
$ mcs --version 
-----------------------------------
Mono C# compiler version 3.99.0.0

--------------------------
$ mcs /t:library Test.cs 
--------------------------
Test.cs(9,20): error CS0053: Inconsistent accessibility: property type `A.C' is less accessible than property `B.D.Property'
Test.cs(3,30): (Location of the symbol related to previous error)
Compilation failed: 1 error(s), 0 warnings


----------------------------------------------------
$ csc /t:library Test.cs
----------------------------------------------------
Microsoft (R) Visual C# Compiler version 4.0.30319.18408
for Microsoft (R) .NET Framework 4.5
Copyright (C) Microsoft Corporation. All rights reserved.

Edward Moriarty | Junior Engineer
Coverity | The Leader in Development Testing
Comment 1 Marek Safar 2015-04-03 12:12:59 UTC
Fixed in master