DEV Community

loading...

Discussion on: The perfect non-null test

Collapse
monkey0506 profile image
Michael Rittenhouse

So, now I have this.

public static bool operator ==(Widget? lhs, Widget? rhs)
{
    return lhs is object ? lhs.Equals(rhs) : rhs is null;
}

I kind of like it. :)