空迴歸
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()