My IDE (Rider) keeps suggesting I use
if(s is { })
For null checks, in place of
if(s == null)
After some reaserch it seems like this is becoming the canonical way to do null checks in c#, and it clearly does have some benifits.
However in unity, there are really good reasons why you generally don't want to bypass the overriden equality operator. In other instances where this would happen, like the various null coalescing operators, I get very nice warnings about them not being safe with monobehaviour objects.
The above code generates no such warnings.
My question is, is this actually a safe way to do a null check on monobehaviours or should we still prefer explicit use of ==?