我不是经验丰富的 C# 开发人员。以下示例显示
IList.IndexOf()
未针对数组解析。
byte[] bytes = {1, 2};
Console.WriteLine(Array.IndexOf(bytes, (byte)1));
Console.WriteLine(((IList<byte>)bytes).IndexOf(1));
// This will result in "CS1501: No overload for method 'IndexOf' takes 1 arguments"
// Console.WriteLine(bytes.IndexOf(1));
我正在阅读规范。相关规范在哪里?
我正在使用 dotnet-sdk-6.0.