DEV Community

Discussion on: Kotlin - Generics & Type variance

Collapse
 
temnur profile image
temnur • Edited

Thanks for post.
Instead of here:

val d: Animal = dogList.getAll() // 💥 Type mismatch

I waited for:

val d: List<Animal> = dogList.getAll() // 💥 Type mismatch
Collapse
 
sendilkumarn profile image
Sendil Kumar

oops you are correct, I guess I didnt update the code.