Why can't a class extend its own nested class in C#?

前端 未结 6 1485
半阙折子戏
半阙折子戏 2020-12-08 14:25

For example:

public class A : A.B
{
    public class B { }
}

Which generates this error from the compiler:

Circular

6条回答
  •  旧巷少年郎
    2020-12-08 14:51

    This makes no sense to me... You are trying to extend something that doesn't exist !!! Class B only exists in the scope of class A and because of this I think there is some kind of inheritance.

提交回复
热议问题