-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Filter RequiresLocationAttribute
from ref readonly
parameters
#68870
Filter RequiresLocationAttribute
from ref readonly
parameters
#68870
Conversation
Assert.Empty(attribute.ConstructorArguments); | ||
Assert.Empty(attribute.NamedArguments); | ||
} | ||
Assert.Empty(parameter.GetAttributes()); |
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.
Unfortunately, it means the presence of the attribute cannot be verified using compiler APIs anymore, I think. But it's still verified in the sense that it makes PEParameterSymbol.RefKind
to be decoded correctly as RefReadonlyParameter
if the attribute is present.
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 1)
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 1)
Seems that
PEParameterSymbol.GetAttributes()
excludesIsReadOnlyAttribute
forin
parameters, so analogously, this PR makesref readonly
parameters excludeRequiresLocationAttribute
.Speclet: https://github.com/dotnet/csharplang/blob/cd336064a26a43c31c1164ef7cd3f5feb4420d20/proposals/ref-readonly-parameters.md
Test plan: #68056