-
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
Make method abstract and force subclasses to implement #72145
Conversation
@@ -5,43 +5,39 @@ | |||
using System.Threading; | |||
using System.Threading.Tasks; | |||
|
|||
namespace Microsoft.CodeAnalysis | |||
namespace Microsoft.CodeAnalysis; |
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.
view with whitespace off.
{ | ||
public abstract Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken); |
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 far preferred subclasses having to be intentional about what they should do here. i already did something similar for CanUpdateCompilationWithStaleGeneratedTreesIfGeneratorsGiveSameOutput previously.
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.
now, the only non-abstract method is TryMergeWithPrior. And that one is fine to stay virtual as it's only used as a perf optimization, not a correctness one.
.../Solution/SolutionCompilationState.CompilationAndGeneratorDriverTranslationAction_Actions.cs
Outdated
Show resolved
Hide resolved
…ationState.CompilationAndGeneratorDriverTranslationAction_Actions.cs
public override bool CanUpdateCompilationWithStaleGeneratedTreesIfGeneratorsGiveSameOutput => true; | ||
|
||
public override Task<Compilation> TransformCompilationAsync(Compilation oldCompilation, CancellationToken cancellationToken) |
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.
for cases where there was an existing comment explaining things, i didn't comment.
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.
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.
Looks good too.
No description provided.