codeanalyzers
codeanalyzers copied to clipboard
Potential improvement of U2U1001
Code snippet:
MethodConsumer.Consume(Implementation.Instance.Method);
sealed class Implementation {
internal static Implementation Instance = new Instance();
private Implementation() {}
internal void Method() {
// do something
}
}
Class Implementation
triggers U2U1001. However, if we make it a static class, MethodConsumer.Consume(Implementation.Instance.Method);
will trigger another warning.