How to do unboxing in Kotlin?

Viewed 33

I have a java method that takes a primitive long type.

I need to invoke the method using reflection, but when I pass my Long object to it I get java.lang.IllegalArgumentException.

I suspect this is due to the fact that the function wants a long primitive and not a Long object.

I'm new with Kotlin but I get that there is no unboxing in it.

I can't change the method.

How do I solve this?

0 Answers
Related