I think the problem is that the KClass is of `java...
# announcements
d
I think the problem is that the KClass is of
java.lang.Double
@groostav playing around in the repl, I can't get a KClass of
java.lang.Double
... it seems to want to convert to
kotlin.Double
. Maybe you're getting some weird type inference edge case?
(also, in this particular example, why not just make extensions on
Pointer<Double>
,
Pointer<Int>
, etc directly?)
Copy code
@JvmName("toDoubleList")
fun Pointer<Double>.toList(size: Int) = pointer.getDoubleArray(0, size).asList()
@JvmName("toIntList")
fun Pointer<Int>.toList(size: Int) = pointer.getIntArray(0, size).asList()
g
thats a really good question. I've used that feature but my java brain still doesnt understand extension functions on closed-generic types