What's the best way to get a `Class` instance in k...
# reflect
j
What's the best way to get a
Class
instance in kotlin that is equal to
void.class
in java?
Unit::class.java
doesn't do it:
Copy code
>>> System.out::class.java.methods.first {it.name == "println"}.returnType == Unit::class.java
res1: kotlin.Boolean = false
(I'm using bytebuddy to dynamically generate a method and need it to be declared
void
to be used properly by some jersey code)
e
Copy code
Nothing::class.javaPrimitiveType
j
Thanks that works too, what are the advantages / disadvantages of
Nothing::class.javaPrimitiveType
vs
Void.TYPE
?