C#6 Elvis运算符(空传播)是否短路

Does C# 6 Elvis operator (null propagation) short circuit

为什么此 C# 代码抛出空异常?

bool boolResult = SomeClass?.NullableProperty.ItsOkProperty ?? false;

一旦 NullableProperty 计算为 null,猫王运算符是否应该停止计算(短路)?

根据我的理解,上面的代码行是以下内容的快捷方式:

bool boolResult 
if(SomeClass != null)
    if(SomeClass.NullableProperty != null)
        boolResult = SomeClass.NullableProperty.ItsOkProperty;
    else
        boolResult = false;
else
    boolResult = false;

我是不是猜错了?

编辑:现在我明白为什么我弄错了,这行代码实际上翻译成类似于:

bool boolResult 
if(SomeClass != null)
    boolResult = SomeClass.NullableProperty.ItsOkProperty;
else
    boolResult = false;

并抛出,因为 NullableProperty 为空...

您需要链接,因为 NRE 在第二个参考上:

bool boolResult = SomeClass?.NullableProperty?.ItsOkProperty ?? false;