mike_shysh
06/27/2019, 10:52 AMClass<T> type
Is it possible to provide List<ObjectA>.class (seems such syntax is not ok in kotlin)?diesieben07
06/27/2019, 10:57 AMObjectA::class
gives you the KClass
, ObjectA::class.java
gives you the Class
.
However because generics are erased, List<ObjectA>::class
is not allowed because it does not make sense.mike_shysh
06/27/2019, 10:58 AMDias
06/27/2019, 11:00 AMdiesieben07
06/27/2019, 11:00 AMtypeOf
, which is a nicer way of doing thatDias
06/27/2019, 11:02 AMmike_shysh
06/27/2019, 11:02 AMdiesieben07
06/27/2019, 11:02 AMtypeOf
, which gives you a KType
Class
, there is no way to tell it to compare List<A>
differently from List<B>
, because both of those are just List
at runtime.mike_shysh
06/27/2019, 11:04 AM