Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jjonescz
Copy link
Member

@jjonescz jjonescz commented Mar 23, 2023

Replaces #48754.
Fixes #40229.
Test plan: #67565

@ghost ghost added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Mar 23, 2023
@jjonescz jjonescz force-pushed the 40229-nameof-nested branch from ecf8a7c to 4603d18 Compare March 24, 2023 08:50
@jjonescz jjonescz marked this pull request as ready for review March 24, 2023 09:54
@jjonescz jjonescz requested a review from a team as a code owner March 24, 2023 09:54
@AlekseyTs
Copy link
Contributor

Done with review pass (commit 2)

Copy link
Contributor

@AlekseyTs AlekseyTs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (commit 4)

Copy link
Member

@333fred 333fred left a 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?

@jaredpar
Copy link
Member

Think we can just do an email review for this one.

}

#nullable enable
internal static bool IsFeatureAvailable(SyntaxNode syntax, MessageID feature)
Copy link
Member

@jcouv jcouv Mar 30, 2023

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks.

@jjonescz jjonescz requested a review from a team as a code owner April 3, 2023 14:18
@jjonescz
Copy link
Member Author

@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)
Copy link
Member

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)

@jcouv jcouv self-assigned this Apr 12, 2023
@jcouv jcouv removed the untriaged Issues and PRs which have not yet been triaged by a lead label Apr 12, 2023
@jcouv jcouv added this to the 17.7 milestone Apr 12, 2023
@jcouv
Copy link
Member

jcouv commented Apr 12, 2023

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).

Copy link
Member

@jcouv jcouv left a 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)

@jjonescz jjonescz enabled auto-merge (squash) April 13, 2023 10:37
@jjonescz jjonescz merged commit 077788b into dotnet:main Apr 13, 2023
@jjonescz jjonescz deleted the 40229-nameof-nested branch April 13, 2023 11:09
@ghost ghost modified the milestones: 17.7, Next Apr 13, 2023
@dibarbet dibarbet modified the milestones: Next, 17.7 P1 Apr 25, 2023
AlekseyTs added a commit to AlekseyTs/roslyn that referenced this pull request Dec 10, 2025
…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.
AlekseyTs added a commit that referenced this pull request Dec 11, 2025
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An object reference is required in nameof in attribute usage

6 participants