CA1508 fires for Debug.Assert #6983
Labels
Area-Microsoft.CodeAnalysis.NetAnalyzers
DataFlow
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: CA1508:
Avoid dead conditional code
Steps To Reproduce
net8.0
<AnalysisLevel>latest-all</AnalysisLevel>
Expected behavior
The analyzer should not trigger for a
Debug.Assert
. This is often used to handle code that may make assumptions based on the value of a constant, such as not handling larger code paths or having pre-defined static data and where it may need to be updated if the value of the constant ever changes.Actual behavior
The analyzer is triggered.
The text was updated successfully, but these errors were encountered: