You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's reporting a false positive checking that DateTime? != null:
var punchIn = (DateTime?)t.GetProperty($"SchedulePunchIn{i}Time").GetValue(dbSchedule);
var punchOut = (DateTime?)t.GetProperty($"SchedulePunchOut{i}Time").GetValue(dbSchedule);
if (punchIn != null || punchOut != null) // this line here
Steps To Reproduce
Simply write the following code:
var a = (DateTime?)DateTime.UtcNow;
if (a != null) { }
Expected behavior
It shouldn't cause a warning.
Actual behavior
It causes a warning.
Additional context
N/A
The text was updated successfully, but these errors were encountered:
mavasani
added a commit
to mavasani/roslyn-analyzers
that referenced
this issue
Nov 6, 2020
Analyzer
Diagnostic ID: CA1508:
Avoid dead conditional code
Analyzer source
NuGet Package: Microsoft.CodeAnalysis.FxCopAnalyzers
Version: v3.3.1 (Latest)
Describe the bug
It's reporting a false positive checking that
DateTime? != null
:Steps To Reproduce
Simply write the following code:
Expected behavior
It shouldn't cause a warning.
Actual behavior
It causes a warning.
Additional context
N/A
The text was updated successfully, but these errors were encountered: