re-sharper contradiction C# 8 nullable references

In the first image, if account may be null, and I can make it null (the RHS of assignment returns `..... FirstOrDefaultAsync()` )

How is it that it is reported that this expression is always false???

 

2 comments
Comment actions Permalink

What does the GetAccountByIdAsync method look like? Maybe R# is analysing that method and determining that the task result is never null.

0
Comment actions Permalink

Syengulalp Dev Which ReSharper version do you run?

Could you show the GetAccountByIdAsync declaration? Does it have any attributes? Does it have nullable types enabled?

Do you have the setting enabled? ReSharper | Options | Code Inspection | Settings | "Enable nullability analysis when C# 8 compiler nullable warnings are enabled"

0

Please sign in to leave a comment.