-
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
Avoid infinite cycle caused by an early binding of DefaultParameterValue attribute. #70242
Conversation
…e attribute. Fixes dotnet#70206. Also: - Add support for using `nameof` in early bound well-known attributes - Address a number of issues with support for Asc, AscW, Chr, ChrW VB functions in early bound well-known attributes
@dotnet/roslyn-compiler Please review |
1 similar comment
@dotnet/roslyn-compiler Please review |
switch (node.Kind()) | ||
BoundExpression result = bindExpressionInternal(node, diagnostics, invoked, indexed); | ||
|
||
if (IsEarlyAttributeBinder && result.Kind == BoundKind.MethodGroup && (!IsInsideNameof || EnclosingNameofArgument != node)) |
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.
I was wondering in what scenario is EnclosingNameofArgument != node
needed for correct behavior?
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.
I was wondering in what scenario is
EnclosingNameofArgument != node
needed for correct behavior?
I have taken a conservatives approach to check for scenarios that I think can result in a successful binding in a most precise way. It is quite possible that I am missing some scenario and this condition is too strict, but I cannot think of any at the moment.
@dotnet/roslyn-compiler For the second review |
2 similar comments
@dotnet/roslyn-compiler For the second review |
@dotnet/roslyn-compiler For the second review |
Fixes #70206.
Also:
nameof
in early bound well-known attributes in VB