This is the screenshot of the error:
I'm using Intellij v14.0.1 + Kotlin plugin v0.9.206. My understanding is that after the null check, the compiler shouldn't show me the error. Am I wrong?
target
属性是var
,这就是为什么它不保证在第三行上这个属性不能为null(例如另一个线程可以将它设置为null
)
AFAIK, a property can be a method call and then nothing can be guaranteed. Use a local val
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.