Skip to content
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

[semi-auto-props]: Disallow 'nameof(field)' #60384

Merged

Conversation

Youssef1313
Copy link
Member

@Youssef1313 Youssef1313 commented Mar 25, 2022

Test plan: #57012

cc @AlekseyTs @333fred

@Youssef1313 Youssef1313 requested a review from a team as a code owner March 25, 2022 17:53
@ghost ghost added the Community The pull request was submitted by a contributor who is not a Microsoft employee. label Mar 25, 2022
@333fred
Copy link
Member

333fred commented Mar 29, 2022

Done review pass (commit 2)

@Youssef1313
Copy link
Member Author

@333fred @AlekseyTs Can you take another look please? Thanks!

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.

LGTM (commit 3). @AlekseyTs for the second review.

@Youssef1313
Copy link
Member Author

@AlekseyTs Can you take a look please? Thanks!

@@ -1557,7 +1557,8 @@ private BoundExpression BindDefaultExpression(DefaultExpressionSyntax node, Bind
// Cannot escape out of the current expression, as it's a compiler-synthesized location.
expression = new BoundDiscardExpression(node, LocalScopeDepth, type: null);
}
else if (node.Identifier.ContextualKind() == SyntaxKind.FieldKeyword &&
else if (!IsInsideNameof &&
Copy link
Contributor

@AlekseyTs AlekseyTs Apr 4, 2022

Choose a reason for hiding this comment

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

!IsInsideNameof &&

I think it would be better to report an error, but not change what is in scope inside nameof. #Closed

@AlekseyTs
Copy link
Contributor

Done with review pass (commit 3)

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)

@AlekseyTs
Copy link
Contributor

@333fred Please review latest changes.

@AlekseyTs
Copy link
Contributor

@Youssef1313 Consider resolving the merge conflict

@333fred 333fred merged commit 8913d16 into dotnet:features/semi-auto-props Apr 6, 2022
@Youssef1313 Youssef1313 deleted the semi-nameof-disallow branch April 6, 2022 13:52
AlekseyTs pushed a commit that referenced this pull request Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Community The pull request was submitted by a contributor who is not a Microsoft employee.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants