I looked around a bit, but could not find an answer to how the new C # 6.0 compiler breaks a new NULL distribution command for something like the following:
BaseType myObj = new DerivedType(); string myString = (myObj as DerivedType)?.DerivedSpecificProperty;
I want to know exactly how he handles this.
Does it as cast to a new DerivedType variable (i.e. it's just syntactic sugar for casting as followed by a null comparison).
Or, if it is actually as , do it, check the value is null, and then, if not null, convert and continue moving.
source share