https://kotlinlang.org logo
Title
a

Andrew Gazelka

01/27/2019, 3:02 AM
any idea why I am getting this?
override fun <SubsystemStateCondition>getConditionValue(): SubsystemStateCondition {
        return state
    }
interface Condition {
    fun <T> getConditionValue(): T
}
n

Nikky

01/27/2019, 4:06 AM
i think you want to have T on the interface.. i am not sure if overriding functions can permanently fix a generic parameter to a type but the error message does seem a bit confusing to me too
d

Dico

01/27/2019, 4:55 AM
Remove the type parameter so that the return type is resolved to your real type called SybsystemStateCondition
p

Pavlo Liapota

01/27/2019, 8:40 AM
Yea, I guess you want to move generic type parameter
<T>
from function to interface, then your class can implement interface with
SubsystemStateCondition
type parameter and return type of overridden function will be fixed.