-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Do not make assumptions about content of erroneous BoundCall node based on value of InvokedAsExtensionMethod property #80256
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
…ed on value of InvokedAsExtensionMethod property Related to dotnet#78433.
333fred
left a comment
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.
Just a couple of minor comments.
| // y.MemberwiseClone(); // warning2 | ||
| Diagnostic(ErrorCode.WRN_NullableValueTypeMayBeNull, "y").WithLocation(15, 9), | ||
| // (15,11): error CS1540: Cannot access protected member 'object.MemberwiseClone()' via a qualifier of type 'int?'; the qualifier must be of type 'Program' (or derived from it) | ||
| // y.MemberwiseClone(); // warning2 |
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 adjusting the // warning2 comment (there is no warning anymore, just an error)
|
|
||
| void visitArguments(BoundCall node, ref readonly MethodInvocationInfo methodInvocationInfo) | ||
| { | ||
| if (node.IsErroneousNode) |
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.
Why have you introduced these local functions (visitReceiver and visitArguments)? Couldn't the if (node.IsErroneousNode)s be added to the existing instance methods? #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.
Why have you introduced these local functions
Because my intent is to adjust behavior of VisitCall method. I have no intent to affect any other existing or future callers of the other methods.
Related to #78433.