Chetan Sachdeva
12/22/2020, 6:19 PMclass ClassA<B: ClassB<*>> {
}
class ClassB<A: ClassA<*>> {
}
I’m getting an error: This type parameter violates the Finite Bound Restriction .
What am I doing wrong here?Chetan Sachdeva
12/22/2020, 6:21 PM<*>):
class ClassA<B: ClassB> {}
class ClassB<A: ClassA> {}Vampire
12/22/2020, 6:25 PMClassA you use as type argument for ClassB has no type argument and the ClassB you use as type argument for ClassA has no type argument, so there are no problems.
With Kotlin raw types (which should not be used anyway) are right away not present.Vampire
12/22/2020, 6:27 PMClassA would need a type argument of ClassB which would need a type argument of ClassA which would need a type argument of ClassB, ...
I guess this cannot work out properlyChetan Sachdeva
12/23/2020, 6:38 AM