-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Allow nested instance member access in nameof in static context
#67461
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
Co-authored-by: Yair Halberstadt <[email protected]>
ecf8a7c to
4603d18
Compare
|
Done with review pass (commit 2) |
AlekseyTs
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.
LGTM (commit 4)
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.
Overall LGTM. @jaredpar, do you think we need a full feature review for this, or should we just do it by email?
|
Think we can just do an email review for this one. |
| } | ||
|
|
||
| #nullable enable | ||
| internal static bool IsFeatureAvailable(SyntaxNode syntax, MessageID feature) |
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.
Could we use the existing CSharpCompilationExtensions.IsFeatureEnabled(this CSharpCompilation, MessageID) instead of introducing a new helper? #Closed
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.
Yes, thanks.
|
@dotnet/roslyn-compiler for a second review if there are no more test suggestions |
|
|
||
| Assert.True(model.GetSpeculativeSymbolInfo(argument2.Position, argument2, SpeculativeBindingOption.BindAsTypeOrNamespace).IsEmpty); | ||
|
|
||
| void verifySymbolInfo(SymbolInfo symbolInfo) |
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.
nit: when possible, let's avoid nested local functions (for future consideration)
|
Please update the listing on feature status page with new link to test plan. Other info in there probably needs to be updated as well for this feature (dev, reviewers, status). |
jcouv
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.
LGTM Thanks (iteration 11)
…er chain The binder with the flag was injected manually as the current binder while binding attributes. Because of that BinderFlags.AttributeArgument was not preserved by `GetBinder` APIs. For example the API is used during binding of `nameof`. Various checks responsible for breaking infinite binding cycles were relying on the presence of the flag. Since after the change the flag is preserved when we are binding `nameof`, I had to add a fixup in several places to properly support IDS_FeatureInstanceMemberInNameof in context of an attribute. See dotnet#67461 that initially added support for the feature.
…nder chain (#81628) Fixes #81576. A binder with the flag was injected manually as the current binder while binding attributes. Because of that `BinderFlags.AttributeArgument` was not preserved by `GetBinder` API. For example the API is used during binding of `nameof`. Various checks responsible for breaking infinite binding cycles are relying on presence of the flag. Since after the change the flag is preserved when we are binding `nameof`, I had to add a fixup in several places to properly support `IDS_FeatureInstanceMemberInNameof` feature in context of an attribute. See #67461 that initially added support for the feature.
Replaces #48754.
Fixes #40229.
Test plan: #67565