Android Kotlin 开发问题:‘lateinit‘ modifier is not allowed on properties of primitive types.
privatelateinitvaruserId:Int在 Android Kotlin 开发中上述代码出现如下错误信息lateinit modifier is not allowed on properties of primitive types.问题原因lateinit 不能用于基本类型Int 是 Kotlin 的基本类型lateinit 只适用于引用类型处理策略使用默认值privatevaruserId:Int0或者使用可空类型但需要安全调用privatevaruserId:Int?null...userId?.let{...}