apatrida
10/06/2015, 5:09 PMpublic inline fun <reified T: Any> fullType(): TypeReference<T> = object:TypeReference<T>(){}
public abstract class TypeReference<T> protected constructor() {
public val type: Type by lazy {
javaClass.getGenericSuperclass() let { superClass ->
if (superClass is Class<*>) {
throw IllegalArgumentException("Internal error: TypeReference constructed without actual type information")
}
(superClass as ParameterizedType).getActualTypeArguments()[0]
}
}
}