Kotlin中方法调用参数可能为null得正确写法

编译错误信息如下:

Smart cast to 'Node' is impossible, because 'left' is a mutable property that could have been changed by this time

Smart cast to 'xxxx' is impossible, because 'xxxx' is a property that has open or custom getter

例如下边这行代码 

解决方法:1:是使用本地变量。 2:使用safe call 安全调用。 3: Elvis操作符 

你可能感兴趣的:(Kotlin中方法调用参数可能为null得正确写法)