Cannot convert generic type to generic of Any/super class

Viewed 457

I'm trying to understand why i'm getting error in the following code:

class A <T> {}
class B {}
class C : B {}

let a = A<C>() as A<B>

While this line of code is working:

let b = C() as B
0 Answers
Related