更新:2007 年 11 月
错误消息
关键字“base”在静态方法中不可用在
示例
下面的示例生成 CS1511。
// CS1511.cs
// compile with: /target:library
public class A
{
   public int j = 0;
}
class C : A
{
   public void Method()
   {
      base.j = 3;   // base allowed here
   }
   public static int StaticMethod()
   {
      base.j = 3;   // CS1511
      return 1;
   }
} | |