Does C# 6 Elvis operator (null propagation) short circuit
问题 Why this c# code throws a null exception? bool boolResult = SomeClass?.NullableProperty.ItsOkProperty ?? false; Isn´t elvis operator supposed to stop evaluation (short circuit) once the NullableProperty evaluates to null? In my understanding the line of code above is a shortcut for: bool boolResult if(SomeClass != null) if(SomeClass.NullableProperty != null) boolResult = SomeClass.NullableProperty.ItsOkProperty; else boolResult = false; else boolResult = false; Did I assume wrong? EDIT: Now I