gpt4 book ai didi

c# - 为什么 C# 中 Int32 结构的 MinValue 前面有两个减号?

转载 作者:太空狗 更新时间:2023-10-29 21:48:33 24 4
gpt4 key购买 nike

当我在我的代码中右键单击 int 并选择“Go To Definition”时,Visual Studio 打开一个名为“Int32 [from metadata]”的文件。该文件包括以下行:

public const Int32 MinValue = --2147483648;

双号是什么意思?

enter image description here


我正在运行 Visual Studio 15.8.4。根据评论中的信息,这不能在所有版本的 Visual Studio 2017 上重现。

最佳答案

vcsjones指向新创建的bug report这篇文章出现在那里:

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.

关于c# - 为什么 C# 中 Int32 结构的 MinValue 前面有两个减号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52284085/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com