-
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
Add IMethodSymbol.IsReadOnly to public API #34514
Add IMethodSymbol.IsReadOnly to public API #34514
Conversation
@RikkiGibson tests are failing. |
I don't see any tests for these APIs. Do we already have them? |
Done review pass (commit 1) |
Weird, it seems like this error should have come up right away locally. Will fix. |
The implementations via |
This would probably be good to test. We have a number of public and internal APIs already that are implemented differently, if we ever change the internal version it'd be good to verify the public ones as well. |
src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationAbstractMethodSymbol.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationMethodSymbol.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationAbstractMethodSymbol.cs
Outdated
Show resolved
Hide resolved
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 5) with the namespace change revert and Chuck's suggestion of ExceptionUtilities.Unreachable
I don’t think we need two APIs here. The user should only (usually) care about effective. If they care about the syntax that was used they can look at the syntax. I recommend |
How does this affect SymbolDisplayVisitor? Should it just always display a |
This can be deferred until after the feature gets merged, especially because as the PR description notes, "effective readonly" can be checked via |
ef0467b
to
b765226
Compare
The public API has been simplified down to |
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.
Please make this API work for reduced extension methods.
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 12)
@dotnet/roslyn-compiler Could I get a second sign-off please? |
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.
This proposes adding the following public API to
IMethodSymbol
:Note that once the last prototype comments are addressed, the check
methodSymbol.IsReadOnly
will be basically equivalent tomethodSymbol.ThisParameter.RefKind == RefKind.In
.