I'm running into trouble because:
>>> Boolean::class.java == java.lang.Boolean.TYPE
true
but:
>>> inline fun <reified T : Any> reifiedClass () = T::class.java
>>> reifiedClass<Boolean>() == java.lang.Boolean.TYPE
false
>>> reifiedClass<Boolean>() == java.lang.Boolean::class.java
true
Is it intentional that reifying a type results in the boxed type literal being provided rather than the primitive type literal? I was under the assumption that an inline function was equivalent to its expanded code, but in this case it changes things subtly.
Maybe I'm misunderstanding Any, but I believe Any to be a (synthetic) supertype over both value types (Boolean, Int, Long, etc.) and reference types, so by using Any as an upper bound in my inline function, I'm not causing the boxing.