Is it safe to cast `T & Any` to `T`?
# getting-started
c
Is it safe to cast
T & Any
to
T
?
j
You shouldn't need to, it's already of type
T
c
I’m getting an error I don’t quite understand (“DataState” is my own wrapper class)
Kotlin 1.6.20 (edited to say .20)
j
This is not the same as casting
T & Any
to
T
, what's the variance of
DataState
?
c
Ah! I had
out T
Dropping the projection fixes it
Thanks for responding
👍 1