[typeless extension receivers] Tests for tuple-literal receivers#83405
Draft
CyrusNajmabadi wants to merge 290 commits intodotnet:features/extension-members-on-typeless-receiversfrom
Conversation
added 18 commits
April 26, 2026 00:44
Two tests: extension(int?) OrZero on (b?null:int) with execution, no-candidate negative. Co-authored-by: Isaac
Two tests covering modern extension properties on conditional expressions. Co-authored-by: Isaac
Closes the ConditionalExpression area (4 of 4 shape PRs). Co-authored-by: Isaac
…receiver Adds BoundKind.UnconvertedSwitchExpression to the inclusion list so that switch expressions with no common arm type route through the typeless- extension-receiver path. All eight .NET Core CSharp test projects pass with zero failures. Co-authored-by: Isaac
Two tests covering classic extension methods on switch expressions with no common arm type. One executes, one negative. Co-authored-by: Isaac
Two tests covering modern extension methods on switch expressions. Co-authored-by: Isaac
Two tests covering modern extension properties on switch expressions. Co-authored-by: Isaac
Closes the SwitchExpression area (4 of 4 shape PRs). Co-authored-by: Isaac
Adds BoundKind.TupleLiteral to the inclusion list so tuple literals (with or without typeless elements) route through the typeless-extension-receiver path. All eight .NET Core CSharp test projects pass with zero failures. Co-authored-by: Isaac
Consolidates the four shape PRs for the CollectionExpression area into a
single Tests PR. The area covers extension members invoked on a typeless
collection-expression receiver. All four shape combinations:
- ClassicExtensionMethod: 18 tests (target type variety, edge cases,
generic inference, overload resolution, chained, argument forwarding).
- ModernExtensionMethod: 2 execution tests.
- ModernExtensionProperty: 8 tests (instance properties on various
target types, chained access, spread elements).
- ModernExtensionIndexer: 2 pin tests (instance indexers in extension(T)
blocks are not allowed; element access via [] on a typeless receiver
is out of scope per the proposal).
Note: Classic and ModernMethod test files originate earlier in this PR's
stack lineage. The Property and Indexer files are added in this commit.
The cumulative diff vs main shows all four area test files.
Co-authored-by: Isaac
Consolidates four shape PRs (formerly dotnet#83356, dotnet#83357, dotnet#83358, dotnet#83359) into a single tests PR for the Lambda area. Covers extension members invoked on a lambda receiver: - ClassicExtensionMethod: 9 tests including the Memoize headline. - ModernExtensionMethod: 4 tests on Func<int,int> / Action / Func<T,T>. - ModernExtensionProperty: 3 tests. - ModernExtensionIndexer: 2 pin tests. Co-authored-by: Isaac
Consolidates four shape PRs (formerly dotnet#83361, dotnet#83362, dotnet#83363, dotnet#83364) into a single tests PR for the MethodGroup area. Covers extension members invoked on a method-group receiver - the proposal's Memoize headline: - ClassicExtensionMethod: 6 tests (static / instance / generic / Memoize / overloaded-with-no-natural-type / negative). - ModernExtensionMethod: 3 tests. - ModernExtensionProperty: 2 tests. - ModernExtensionIndexer: 2 pin tests. Co-authored-by: Isaac
Consolidates four shape PRs (dotnet#83366, dotnet#83367, dotnet#83368, dotnet#83369) into a single tests PR for the NewExpression area (target-typed new() / new(args) receivers). - ClassicExtensionMethod: 4 tests. - ModernExtensionMethod: 3 tests. - ModernExtensionProperty: 3 tests. - ModernExtensionIndexer: 2 pin tests. Co-authored-by: Isaac
Consolidates four shape PRs (dotnet#83371, dotnet#83372, dotnet#83373, dotnet#83374) into a single tests PR for the NullLiteral area. - ClassicExtensionMethod: 5 tests. - ModernExtensionMethod: 3 tests. - ModernExtensionProperty: 2 tests. - ModernExtensionIndexer: 2 pin tests. Co-authored-by: Isaac
Consolidates four shape PRs (dotnet#83376, dotnet#83377, dotnet#83378, dotnet#83379). Co-authored-by: Isaac
Consolidates four shape PRs (dotnet#83381, dotnet#83382, dotnet#83383, dotnet#83384). Co-authored-by: Isaac
Consolidates four shape PRs (dotnet#83386, dotnet#83387, dotnet#83388, dotnet#83389). Co-authored-by: Isaac
Consolidates four shape PRs (dotnet#83391, dotnet#83392, dotnet#83393, dotnet#83394). Co-authored-by: Isaac
This was referenced Apr 25, 2026
added 23 commits
April 26, 2026 14:28
…n/Tests' into extension-members-on-typeless-receivers/TupleExpression/Support
…/Support' into extension-members-on-typeless-receivers/TupleExpression/Tests
When the speculative-binding redesign (in /product) made the typeless- receiver helper only engage when an extension candidate is in scope, these tests' "no extension found" assertions started reporting the legacy ERR_BadUnaryOp from the UnboundLambda rejection in BindMemberAccessWithBoundLeft instead of the new ERR_NoSuchMember. Updated three tests across Classic / ModernMethod / ModernProperty. Co-authored-by: Isaac
…nto extension-members-on-typeless-receivers/MethodGroup/Support
…port' into extension-members-on-typeless-receivers/MethodGroup/Tests
…llback
Three method-group "no extension found" tests now expect the legacy
ERR_BadSKunknown ('method is not valid in the given context') instead of
ERR_NoSuchMember, since the speculative-binding redesign falls back to
the legacy path when no extension candidate is in scope.
Co-authored-by: Isaac
…ts' into extension-members-on-typeless-receivers/NewExpression/Support
…upport' into extension-members-on-typeless-receivers/NewExpression/Tests
…fallback Three new()-receiver "no extension found" tests now expect the legacy ERR_ImplicitObjectCreationNoTargetType instead of ERR_NoSuchMember. Co-authored-by: Isaac
…ests' into extension-members-on-typeless-receivers/NullLiteral/Support
…port' into extension-members-on-typeless-receivers/NullLiteral/Tests
…llback Three null-receiver "no extension found" tests now expect the legacy ERR_BadUnaryOp on '<null>' instead of ERR_NoSuchMember. Co-authored-by: Isaac
…ts' into extension-members-on-typeless-receivers/DefaultLiteral/Support
…Support' into extension-members-on-typeless-receivers/DefaultLiteral/Tests
… fallback Three default-receiver "no extension found" tests now expect the legacy ERR_DefaultLiteralNoTargetType instead of ERR_NoSuchMember. Co-authored-by: Isaac
…Tests' into extension-members-on-typeless-receivers/ConditionalExpression/Support
…ession/Support' into extension-members-on-typeless-receivers/ConditionalExpression/Tests
…binding fallback Three conditional-receiver "no extension found" tests now expect the legacy ERR_InvalidQM (no common conditional type) instead of ERR_NoSuchMember. Co-authored-by: Isaac
…ession/Tests' into extension-members-on-typeless-receivers/SwitchExpression/Support
…n/Support' into extension-members-on-typeless-receivers/SwitchExpression/Tests
…ng fallback Three switch-receiver "no extension found" tests now expect the legacy ERR_SwitchExpressionNoBestType instead of ERR_NoSuchMember. Co-authored-by: Isaac
…n/Tests' into extension-members-on-typeless-receivers/TupleExpression/Support
…/Support' into extension-members-on-typeless-receivers/TupleExpression/Tests
Member
|
Test plan: #83428 |
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.
Championed issue: TBD
Speclet: TBD
Test plan: TBD
Summary
Stacked: