https://kotlinlang.org logo
a

athor

03/13/2017, 1:26 AM
I’m trying to override a property of a super class and return a super type of that property, but kotlin is complaining. Is it possible? Something like this:
Copy code
interface MyInterface {}
interface MyBetterInterface :MyInterface {}

open class Base {
    open var myinterface: MyInterface? = null
}

class Derived : Base() {
    override var myinterface: MyBetterInterface? = null
}