I'm trying to figure out how to annotate a null checking method so code that follows it is not marked as a possible null reference exception.
public bool IsNull(object value)
return value == null;
public void DoSomething()
object someValue = null;
Console.WriteLine("someValue is null");
Console.WriteLine("someValue = " + someValue.ToString());
Today, ReSharper marks "someValue" in the else block as a possible null reference exception even though it can logically never be null.
Is it possible to annotate the IsNull method somehow to prevent this?
Is there an alternate solution?
I posted a similar question in May that went unanswered at