Jay
04/19/2018, 11:33 AMinterface A<T> {}
class B: A<Apple> {}
class MyClass: B, A<Orange> {}
Kotlin gave me an error: Type parameter T of ‘A’ has inconsistent values: Apple, Orangediesieben07
04/19/2018, 11:46 AMhho
04/19/2018, 11:49 AMlouiscad
04/19/2018, 11:49 AMJay
04/19/2018, 11:54 AMmarstran
04/19/2018, 11:55 AMclass MyClass<T> : B, A<T> where T : Apple, T : Orange
if Apple and Orange were interfaces, but it gives an error. Anyone know what the problem is with that?Type parameter T of 'A' has inconsistent values: Apple, T#1 (type parameter of MyClass)
. Why can't it infer that T#1 is an Apple?petersommerhoff
04/20/2018, 9:09 AMA<Apple>
and an A<Apple and Orange>
at the same time which is not possible due to type erasure (of course in this case it's just redundant so you can just get rid of B)