-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Extension block members do not have this parameter
#80457
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
Conversation
| static bool hasRefToRefStructThis(MethodSymbol? method) | ||
| { | ||
| return method?.TryGetThisParameter(out var thisParameter) == true && | ||
| return method?.TryGetThisParameter(out var thisParameter) == true && thisParameter is not null && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider nullable-enabling TryGetThisParameter to catch these kinds of mistakes sooner in the future #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically this wouldn't help because on this code path null result was unexpected before my change to the behavior of the API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Annotated TryGetThisParameter
|
@jcouv Please review |
| static bool hasRefToRefStructThis(MethodSymbol? method) | ||
| { | ||
| return method?.TryGetThisParameter(out var thisParameter) == true && | ||
| return method?.TryGetThisParameter(out var thisParameter) == true && thisParameter is not null && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should Never mind, I see we already have #ClosedBinder.HasThis(...) method be adjusted as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Thanks (commit 4) with one question
Related to #78968
Relates to test plan #76130