受保护的内部方法不允许内部类作为参数

时间:2016-05-25 02:55:59

标签: c#

此代码无法编译:

try:
    seat = float(seat)
except ValueError:
    print "I'm sorry but {} isn't valid. Please try again.".format(seat) 

编译失败说明:

辅助功能不一致:参数类型internal class Foo {} public abstract class SomeBaseClass { protected internal void ProcessFoo(Foo value) { // doing something... } } 的可访问性低于方法Foo

1 个答案:

答案 0 :(得分:3)

显然,protected internal表示protectedinternal而非protectedinternal正如我所认为的那样。

感谢Michael Liu