fun handle() : String {
null?.let { return "Ololo"}
}
val result = handle()
result.trim() // kotlin.TypeCastException: null cannot be cast to non-null type kotlin.CharSequence
知道为什么 null 安全的 Kotlin 函数返回 null 吗?
最佳答案
关于Kotlin 1.3.11 打破了空安全性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54065158/