Why does the MinValue for an Int32 struct in C# have two minus signs infront of it?

后端 未结 1 387
野的像风
野的像风 2021-01-17 22:27

When I right-click int in my code and select \"Go To Definition,\" Visual Studio opens a file titled \"Int32 [from metadata]\". This file includes the followin

相关标签:
1条回答
  • 2021-01-17 22:48

    vcsjones pointed to the newly created bug report and this post appeared there:

    CyrusNajmabadi commented

    This is probably a bug i introduced when i fixed up how literals were converted to syntax nodes. There was probably some special casing here that added a - sign. And once the underlying helper was fixed we got double negation.

    0 讨论(0)
提交回复
热议问题