-
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
Flatten SourceMethodSymbol hierarchy #76107
Conversation
@@ -1746,5 +1746,78 @@ internal override System.Reflection.MethodImplAttributes ImplementationAttribute | |||
|
|||
internal override int TryGetOverloadResolutionPriority() | |||
=> GetEarlyDecodedWellKnownAttributeData()?.OverloadResolutionPriority ?? 0; | |||
|
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.
These methods were copy/pasted from SourceMethodSymbol.cs
with no changes to their content.
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 3)
Once upon a time, there were source method symbols that didn't have attributes, and thus we had `SourceMethodSymbol` and `SourceMethodSymbolWithAttributes`, to simplify/save on symbol size for such methods. Today, there is no such difference, and the only direct implementor of `SourceMethodSymbol` is `SourceMethodSymbolWithAttributes`. Therefore, I've cleaned up the hierarchy by removing the dead intermediate class.
7edad91
to
330af76
Compare
@cston @jcouv, I've taken advice from Aleksey and restructured the approach to keep everything in the same location; instead, I now just make SourceMethodSymbol a |
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.
Should we also rename the file? Perhaps to SourceMethodSymbol_Attributes.cs
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.
The goal with this version was to reduce noise in git history, so I didn't.
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.
Git would likely detect it as rename, so there would be no noise
Once upon a time, there were source method symbols that didn't have attributes, and thus we had
SourceMethodSymbol
andSourceMethodSymbolWithAttributes
, to simplify/save on symbol size for such methods. Today, there is no such difference, and the only direct implementor ofSourceMethodSymbol
isSourceMethodSymbolWithAttributes
. Therefore, I've cleaned up the hierarchy by removing the dead intermediate class. Highly suggest reviewing commit-by-commit, so that the rename-with-no-changes is correctly displayed. I will not be squash merging this PR to preserve that rename in history as well.