Pri*_*dam 1 kotlin kotlin-coroutines
为什么跟随签名会Unsupported [suspend operator "getValue"]导致编译错误?
suspend operator fun getValue(thisRef: Any?, property: KProperty<*>): T
Run Code Online (Sandbox Code Playgroud)
是因为技术上的限制吗?
该getValue运营商实现的吸气剂val,并有一个这样的东西suspend val-只正常val。
suspend fun不能直接从普通函数(如getter的实现)中调用A ,因此getValue不能将其用于预期的目的。Kotlin通过在尝试创建DLL时给出编译错误来警告您suspend operator fun getValue。
| 归档时间: |
|
| 查看次数: |
71 次 |
| 最近记录: |