DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 968,873 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in

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. :)