-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
IOperation - IOperation API for BoundMethodGroup and BoundPropertyGroup #19965
Comments
Tagging @dotnet/analyzer-ioperation |
@CyrusNajmabadi needed for V1 ? |
No. We don't need this for V1. However, whoever does Nameof needs to make sure it exposes the list of members that were bound. |
I think it is weird to expose members within a nameof expression - in fact the BoundNameOfOperator node doesn't even include any BoundMethodGroup or BoundPropertyGroup: http://source.roslyn.io/#Microsoft.CodeAnalysis.CSharp/Generated/BoundNodes.xml.Generated.cs,985506451dde049a. Instead a better alternative is to just expose the nameof argument as an IOperation, and in future expose these groups. Until then, the recommendation across our entire API surface should be to revert to semantic model to get bound method and property groups. |
I don't think it's weird. It's what the entity inside the nameof ends up meaning semantically.
This is undesirable because now you have to go back to syntax, and handle the syntax for each language separately just to ask a question that can be answered at our common ioperation layer. That said, if this is hard to provide (due to how the bound nodes are structured), then i think it's ok if we punt on having the INameOfOperation actually expose any additional information. We can design and add such a thing later. |
Design Team Decision Lets leave this as is for V1 release. |
@heejaechang Wants to discuss this in the design meeting. |
We need to fix this for 15.5 so that children of bound method and property group are not cut - should be a trivial bug fix. |
Detect references to method/property in bound method group/property group using semantic model APIs. Also provide a different message for methods which have name only references.
Closing as a duplicate of a community-driven issue, #76620. |
WFM. |
Would be valuable for things like INameOfExpression: #19954
Probably also want this for IBadInvocationExpression where the member group can specify the members that the compiler considered.
The text was updated successfully, but these errors were encountered: