Extensions: apply same nullability checks on receiver as for classic extension methods#81871
Merged
Conversation
e03370c to
8fbdbbe
Compare
8fbdbbe to
75cfef6
Compare
jcouv
commented
Jan 7, 2026
RikkiGibson
reviewed
Jan 7, 2026
RikkiGibson
reviewed
Jan 7, 2026
RikkiGibson
reviewed
Jan 7, 2026
RikkiGibson
reviewed
Jan 7, 2026
|
|
||
| void setAnalyzedNullabilityAndUpdateSymbol(BoundAssignmentOperator node, BoundObjectInitializerMember objectInitializer, Symbol? updatedSymbol) | ||
| { | ||
| // https://github.com/dotnet/roslyn/issues/35040: Should likely be setting _resultType in VisitObjectCreationInitializer |
Member
There was a problem hiding this comment.
Is this issue still valid? It seems like since we could be calling this from a continuation, the _resultType may have changed since then. Perhaps we should close that issue out and remove the reference to it. #Resolved
Member
Author
There was a problem hiding this comment.
I think the issue is still valid. The type from initial binding (stored in the bound node) wouldn't have the nullable-updated information.
RikkiGibson
reviewed
Jan 7, 2026
RikkiGibson
reviewed
Jan 7, 2026
RikkiGibson
reviewed
Jan 7, 2026
RikkiGibson
reviewed
Jan 7, 2026
RikkiGibson
reviewed
Jan 7, 2026
RikkiGibson
reviewed
Jan 7, 2026
RikkiGibson
reviewed
Jan 7, 2026
Member
Author
|
@dotnet/roslyn-compiler for second review. Thanks |
RikkiGibson
previously approved these changes
Jan 8, 2026
Reverted changes related to setters
AlekseyTs
reviewed
Jan 9, 2026
| if (isExtensionBlockMember) | ||
| { | ||
| Debug.Assert(symbol is not null); | ||
| refKindsOpt = AdjustArgumentRefKindsIfNeeded(refKindsOpt, isExtensionBlockMember, symbol, objectInitializer.Arguments.Length); |
Contributor
RikkiGibson
approved these changes
Jan 13, 2026
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 #81851 (conversion on extension receiver should be subject to same rules as conversion on
thisparameter). This is just a matter of passing the right flag indicating that the first argument is an extension receiver.For readability, I switched usages of
Actiondelegates to use named delegates.I also switched usages of tuples to use named types (this made it easier to add an extra field).
Relates to #76130