Smart cast to is impossible, because is a mutable property that could have been changed by this time
例如我当前在调用如下方法时候报错,解决方法有两种
lifecycle.addObserver(lifeMc)
解决方法一:重新定义对象类型,但是要确保类型正确
lifeMc as LifeChronometer
解决方法二:延迟加载,不初始化值
...
原创
2022-05-21 20:24:42 ·
1381 阅读 ·
1 评论