False positive "Expression is always false" using Assertions
Hello
i have this code:
var queryByModel = this.GetQueryResult(...)
Debug.Assert(queryByModel != null);
if (queryByModel == null)
{
return new List<TopOffer>();
}
Resharper complains that queryByModel == null expression is always false. This is true for Debug builds, but it should not suggest to do anything about it.
Please sign in to leave a comment.
In debug mode, ReSharper will tell you about heuristically unreachable code.
In release mode, resharper will say nothing.
To modify the code or not - is up to the developer
Warnings generated against the debug.assert obsfucate real heuristically unreachable warnings.