Closed starkcolin closed 8 years ago
Nice catch!
I agree that RNUL should be removed from async methods.
For non-async methods the existing rules should still apply, I believe. Since returning a null task is allowed, so annotating them makes resharper report potential warnings:
Agreed that the warning should still be displayed for non-async methods.
This fix is included in https://github.com/bkoelman/ResharperCodeContractNullability/releases/tag/v1.0.5.
A nullability warning (RNUL) on a method with a signature async Task is redundant, as the Task object returned from this method can never be null.
When the method return type is Task (where T is a reference type), the annotation ItemNotNull/ItemCanBeNull makes sense, but the NotNull/CanBeNull annotation adds no value in this case. When the return type is simply Task, neither of those annotations make sense.