【发布时间】:2020-07-23 01:18:52
【问题描述】:
我正在尝试在 kotlin 中编写一些东西,但我遇到了一些问题。我怎样才能解决这个问题?我分享我的代码..请帮助我!
interface InterfaceType {}
open class ConcreteImpl: InterfaceType {}
class TypeA: ConcreteImpl() {}
fun test() {
var interfaceTypeList: MutableList<InterfaceType> = mutableListOf()
var typeAList: MutableList<TypeA> = mutableListOf()
interfaceTypeList = typeAList
}
【问题讨论】:
-
嗨,我知道你是新来的。如果您认为某个答案解决了问题,请将其标记为已接受。
标签: kotlin inferred-type