Repository navigation
Add regression tests for the remaining open LINQ issues - #1307
Merged
GrahamTheCoder merged 3 commits intoNov 10, 2026
Merged
Conversation
The conversions for icsharpcode#932 (Group By keys named differently from their members) and icsharpcode#1302 (generic method inference with a contravariant base-type comparer) are already correct; these tests pin them, including running the VB and converted C#. icsharpcode#895 is already covered by Issue895_LinqWhereAfterGroupAsync and TestWhereAfterGroup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019FEr8GSsdfh4WNGNkwrb9G
…eeds a variance conversion VB infers an extension method's type arguments from the receiver first, then converts the other arguments, whereas C# infers from all of them together: `values.Distinct(EqualityComparer(Of BaseValue).Default)` makes C# infer BaseValue. The test for icsharpcode#1302 previously passed only because, in some environments, the converter happened to cast the comparer; CI's references don't produce that cast. Fixes icsharpcode#1302 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019FEr8GSsdfh4WNGNkwrb9G
…access The icsharpcode#1302 fix skipped any inferred type parameter, including the caller's own nameable ones, and only handled member access, not ?. member binding, so both shapes still made C# infer the base type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019FEr8GSsdfh4WNGNkwrb9G
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #932
Fixes #1302
Fixes #895
All three already convert correctly on master since #1305. This PR only adds tests to pin that.
#932: Group By keys named differently from their members
Issue932_GroupByKeysNamedDifferentlyFromTheirMembersAsync, using the issue's query. The keys keep their names (new { Agent_First_Name = agent.First_Name, ... }) and the output compiles.TestGroupByKeysNamedDifferentlyFromTheirMembers. It runs a joinedGroup Bywith renamed keys in both VB and C# and compares the results.#1302: generic method inference with a contravariant base-type comparer
VB infers an extension method's type arguments from the receiver first, then converts the other arguments; C# infers from all arguments together, so would infer
BaseValuehere. Where an argument only fits its generic parameter via a variance conversion, the converter now states the type arguments VB inferred:values.Distinct<DerivedValue>(EqualityComparer<BaseValue>.Default).Issue1302_GenericMethodInferenceWithBaseTypeComparerAsync(the issue's code) and self-verifying testTestGenericMethodInferenceWithBaseTypeComparer.GenericMethodWithInterfaceConversionKeepsTypeArgumentsInferredAsyncchecks an ordinary interface conversion doesn't add type arguments.#895: Where after Group By
Already covered:
Issue895_LinqWhereAfterGroupAsync, which now expectswhere Group.Count() > 1 select new { x = Group.Key, Group };TestWhereAfterGroup, which runs the issue's query in VB and C#.