fix:linq collections contain in C# 14#4039
Conversation
|
@StellaAlexis Can you add tests for this? |
@jeremydmiller what kind of additional tests do you want to see? |
|
Noticed the failing tests. Assume that is because of the hardcoded .net 10 framework. Managed to also run the tests without it so removed that part. |
|
We're also affected by this. Temporary solution for us is to pin language version to C# 13 just as seems to have been the prior solution here. Nice to see a fix. |
df1d517 to
f48dee3
Compare
|
I've updated linqtests to test against each langversion we support, so we can catch any ongoing issues in this space. This should be good to go in. |
|
Thanks @Hawxy ! |

When updating my project to .Net 10 and C# 14 I noticed that the linq collection expressions around contains were broken.
References on the change in C#14 can be foundhere
To validate the issue I changed the TargetFramework and LangVersion of LinqTests.csproj. That resulted in a bunch of the existing tests failing right away.
Suggesting a fix similar to how EnumerableContains is written. After the change all Linq tests are passing again.