Null propagation operator and extension methods

Yes. This is a bug. Thanks for bringing this up.
The sample is supposed to compile and should result in a conditional invocation of Get regardless if Get is an extension or not.

Usage of “?.” in cc?.Get() is an indication that caller wants cc null-checked before proceeding further. Even if Get could handle null somehow, caller does not want that to happen.

Leave a Comment