--

The !! operator basically tells the compiler to insert the ArgumentNullException.ThrowIfNull() check. It's a shortcut on top of a shortcut. That's part of the uncertainly around the feature (do we really need a new operator for a simple safety check), but the ability to have this visible in the method signature / metadata could make other types of linting easier, and avoid the extra boilerplate.

--

--

Matthew MacDonald
Matthew MacDonald

Written by Matthew MacDonald

Teacher, coder, long-ago Microsoft MVP. Author of heavy books. Join Young Coder for a creative take on science and technology. Queries: matthew@prosetech.com

No responses yet