https://kotlinlang.org logo
b

benleggiero

03/02/2018, 3:48 AM
How come when I do this:
Copy code
val x = (foo as? Foo<Bar>) ?: Foo<Bar>() // foo was declared as foo: FooType, where FooType is a generic constraint of Foo
I get this?
Copy code
Unchecked cast: FooType to Foo<Bar>
Isn’t
as?
checking stuff? Or am I misunderstanding?