空回归
Function TestFunction() As TestClass
Return Nothing
End Function
坏代码
TestFunction().TestMethod()
好的代码
Dim x = TestFunction()
If x IsNot Nothing Then x.TestMethod()
Version = 14.0
TestFunction()?.TestMethod()
Function TestFunction() As TestClass
Return Nothing
End Function
TestFunction().TestMethod()
Dim x = TestFunction()
If x IsNot Nothing Then x.TestMethod()
TestFunction()?.TestMethod()