-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GetAlternateLookup<ReadOnlySpan<char>>() does not work on FrozenSet<string> in .NET 9 RC 1 #107840
Comments
I believe the problem here is that the reference assembly version of Compare: Line 24 in 4c10eff
runtime/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.net9.cs Line 11 in 4c10eff
Line 24 in 4c10eff
runtime/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.net9.cs Line 25 in 4c10eff
|
This sounds correct. Do you know of a workaround? Or can it only be fixed when the next RC is released? |
Tagging subscribers to this area: @dotnet/area-system-collections |
Fixed by #107846 |
Description
I have installed .NET 9 RC 1 and have found that calling
GetAlternateLookup<ReadOnlySpan<char>>()
onFrozenSet<string>
appears to not be supported. It gives an error of:error CS9244: The type 'ReadOnlySpan' may not be a ref struct or a type parameter allowing ref structs in order to use it as parameter 'TAlternate' in the generic type or method 'FrozenSet.TryGetAlternateLookup(out FrozenSet.AlternateLookup)'
Reproduction Steps
Expected behavior
This should compile because the documentation says it's been added to FrozenSet.
https://learn.microsoft.com/en-us/dotnet/api/system.collections.frozen.frozenset-1.getalternatelookup?view=net-9.0
Actual behavior
The build fails with this error:
error CS9244: The type 'ReadOnlySpan' may not be a ref struct or a type parameter allowing ref structs in order to use it as parameter 'TAlternate' in the generic type or method 'FrozenSet.TryGetAlternateLookup(out FrozenSet.AlternateLookup)'
Regression?
No.
Known Workarounds
None.
Configuration
Visual Studio Community 2022 17.11.3
Windows 10
.NET 9 RC 1
<LangVersion>preview</LangVersion>
Other information
No response
The text was updated successfully, but these errors were encountered: