CA1000
hasn't been reconsidered with static abstracts in mind
#7126
Labels
Area-Microsoft.CodeAnalysis.NetAnalyzers
False_Positive
A diagnostic is reported for non-problematic case
help wanted
The issue is up-for-grabs, and can be claimed by commenting
Milestone
Analyzer
Diagnostic ID: CA1000:
Do not declare static members on generic types
Analyzer source
.NET 8.0.100 SDK
The pattern adopted for generic math in .NET 7, known as "Curiously recurring template pattern", violates this rule. Of course a rule like this one isn't enabled in the runtime repo, but when I tried to do the same I got this diagnostic pop up.
Steps To Reproduce
Using .NET >=7:
Expected behavior
When the member is abstract, this diagnostic should not fire.
Actual behavior
This diagnostic fires.
Additional Context
The above repro is a minimal repro, but this diagnostic still fires when using the recursive pattern:
The text was updated successfully, but these errors were encountered: