bbaldino
10/11/2019, 9:12 PMclass Foo<T : Any>(private val valueType: KClass<T>) {
fun getThing(): T {
return when (valueType) {
// complains here: "Type mismatch, required T found Int" unless I add "as T" at the end
Integer.class -> functionThatReturnsInt()
Double.class, etc....
}
}
}