Bug description
null Task value in ternary operator do not trigger violation
Repro steps
static Task First(bool flag)
{
return flag
? null
: Task.CompletedTask;
}
static Task Second(bool flag) =>
flag
? null
: Task.CompletedTask;
static Task Third(bool flag)
{
if (flag)
{
return null;
}
else
{
return Task.CompletedTask;
}
}
Expected behavior
Expect that all three methods violate the rule
Actual behavior
Only Third violate