Why is this enum declaration working now?

前端 未结 3 612
渐次进展
渐次进展 2020-12-21 01:50

While answering another question, Jon Skeet mentioned that there is a weird thing going on with the definition of enums. His answer.

He states that redi

3条回答
  •  一向
    一向 (楼主)
    2020-12-21 02:39

    Either it's an oversight in the new compiler or they made a decision not to have that inconsistency (?) in the language anymore.

    At the moment there doesn't seem to be an official specification, only a not-so-official-looking git repository where work is being done:

    https://github.com/ljw1004/csharpspec/blob/gh-pages/enums.md

    At the moment it looks like not using the aliases for the underlying enum type should be an error. The language looks to be the same as the previous official spec. But since both the compiler and spec seem to still be works in progress, it's hard to say which one is correct.

提交回复
热议问题