How can we use NotNullWhen attribute (or some alternative?) when #nullable disable?
For example I have an extension method:
public static bool IsNullOrEmpty<T>([NotNullWhen(false)] this IEnumerable<T> e)
{
return e == null || !e.Any();
}
And usage
if(ids.IsNullOrEmpty()
{
throw new Exception();
}
var id = ids.First();
The compiler shows me warning on ids.First():
Possible 'System.NullRefernceException'
If I do #nullable enable the warning disappears. I want to achieve same effect with #nullable disable. Is it possible?
