I am trying to understand Generics here and am struggling. I have a simple code that looks like
interface A {
}
interface B {
}
class C : A, B {
}
fun <T: A> changeVal() : T {
return C()
}
And I get the following error Type mismatch: inferred type is C but T was expected. What am I getting wrong?