DEV Community

Discussion on: Future of C# Event: Submit your questions here!

Collapse
 
greyparrotdev profile image
greyparrotdev

Are the plans to make null conditional (object?.thing) and null coalescent (??, ??=) operators more consistent with the behaviour of boolean null comparison? (e.g.) If the '==' operator is overloaded on specific objects to treat them as null and return a true for null comparison (even when they aren't actually).

Imho, given that both operators are essentially syntactic sugar over comparison with null, it makes sense to have them run the the overloaded logic for the == operator if one exists for the object.

C# after all is a very cohesive language ;-)