Bug 42198

Summary: error CS0529: Inherited interface causes a cycle in the interface hierarchy.
Product: [Mono] Compilers Reporter: jeffp1618
Component: C#Assignee: Marek Safar <masafa>
Status: RESOLVED FIXED    
Severity: normal CC: mono-bugs+mono
Priority: ---    
Version: 4.4.0 (C7)   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Tags: Is this bug a regression?: ---
Last known good build:

Description jeffp1618 2016-06-28 08:16:09 UTC
Compiling the following snippet of code using 'mcs' fails, where as it compiles using 'csc' (v1.2.0.60317) that comes with Visual Studio 2015.

namespace Example
{
    public class A : A.InnerInterface
    {
        public interface InnerInterface
        {
        }

        public static void Main(string[] args)
        {
        } 
    }
}

$ ../mono/bin/mcs --version
Mono C# compiler version 4.4.1.0

$ ../mono/bin/mcs Test.cs
Test.cs(4,18): error CS0146: Circular base class dependency involving `Example.A' and `Example.A.InnerInterface'
Test.cs(6,26): (Location of the symbol related to previous error)
Test.cs(6,26): error CS0529: Inherited interface `Example.A.InnerInterface' causes a cycle in the interface hierarchy of `Example.A.InnerInterface'
Test.cs(6,26): (Location of the symbol related to previous error)
Compilation failed: 2 error(s), 0 warnings
Comment 1 Marek Safar 2016-07-29 13:31:27 UTC
Fixed in master and Mono 4.6