更新:2007 年 11 月
错误消息
“const declaration”的常数值计算涉及循环定义下面的示例生成 CS0110:
// CS0110.cs
namespace MyNamespace
{
   public class A
   {
      public static void Main()
      {
      }
   }
   public class B : A
   {
      public const int i = c + 1;   // CS0110, c already references i
      public const int c = i + 1;
      // the following line would be OK
      // public const int c = 10;
   }
} | |