Does the C# compiler get the Color Color rule wrong with const type members?

后端 未结 3 1111
误落风尘
误落风尘 2021-02-02 07:33

Okay, so the C# Language Specification has a special section (old version linked) on the Color Color rule where a member and its type has the same name. Well-known

3条回答
  •  伪装坚强ぢ
    2021-02-02 08:00

    I am sure it has something to do with the fact that the value of the constant must be deterministic at compile time, but the value of the (static) property will be determined at run-time.

提交回复
热议问题