gpt4 book ai didi

c# - 为什么 Visual Studio 监 window 口显示集合中 ValueTuples 的错误值?

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

我发现当我从集合中访问 ValueTuples 的属性时,它们的计算方式不同。

    public static List<Tuple<string, bool>> MyTupleList = new List<Tuple<string, bool>>
{
new Tuple<string, bool>("test", true)
};

public static List<(string b, bool c)> MyList = new List<(string b, bool c)>
{
("test", true)
};

为什么这两条突出显示的行的计算方式不同,我如何更改“MyList[0].c”以正确获取值?

enter image description here

最佳答案

这似乎是 Visual Studio 2017 中的错误。

Roslyn 的 github 问题跟踪器上提到了一些相关的错误,例如:

由于 Visual Studio 的问题跟踪器未公开,我们只能等待并希望这些错误得到修复。

关于c# - 为什么 Visual Studio 监 window 口显示集合中 ValueTuples 的错误值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53613427/

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