为什么一定要在基类接口之前声明一个派生类时,可以指定?接口、声明、派生类

2023-09-03 16:50:13 作者:孤独劣人

public interface ITest
{
    int ChildCount { get; set; }
}

public class Test
{
}

public class OrderPool : ITest, Test
{
    public int ChildCount
    {
        get;
        set;
    }
}

错误说Base类测试必须来自任何接口之前。 为什么有必要先扩展类,然后实现inteface?

The error says Base class 'Test' must come before any interfaces. Why is it necessary to extend the class first and then implement the inteface?

推荐答案

由于的规范是这么说的第§17.1.2。