This is just like #371, but applies to methods that are virtual and inherited from a base class.
class Base
{
public virtual void Foo() { }
}
class C : Base
{
public override void Foo() { }
}
Becomes:
class Base
{
public virtual void Foo() { }
}
class C : Base
{
public override sealed void Foo() { }
}
An analysis has to be made if the method can me made virtual. The analyzer has to check if there is derived class, and if in those classes if there is an override of the method.
Category: Performance
Diagnostic Id: CC0094
Severity: Hidden
Due to the problems on #293 this is the suggested strategy for this issue:
- Offer the diagnostic on the class declaration only, not anywhere else. It is a simple marker/hidden diagnostic, no further analysis needed.
- The analysis is completed on the code fix provider. It checks, asynchronously, if there are classes overriding that member. If not, the code fix is offer. Otherwise it is not.
It has to check for cancellation frequently, as this analysis made on the code fix provider will be costly.
This is just like #371, but applies to methods that are virtual and inherited from a base class.
Becomes:
An analysis has to be made if the method can me made virtual. The analyzer has to check if there is derived class, and if in those classes if there is an override of the method.
Category:
PerformanceDiagnostic Id:
CC0094Severity:
HiddenDue to the problems on #293 this is the suggested strategy for this issue:
It has to check for cancellation frequently, as this analysis made on the code fix provider will be costly.