Files
kotlin/compiler/testData/codegen/box/reflection/javaProperties/javaReified.kt

27 lines
578 B
Kotlin
Vendored

// WITH_REFLECT
import kotlin.reflect.KClass
inline fun <reified T : Any> check(expected: String) {
val clazz = T::class.java!!
assert (clazz.canonicalName == "java.lang.${expected.capitalize()}") {
"clazz name: ${clazz.canonicalName}"
}
}
fun box(): String {
check<Boolean>("boolean")
check<Char>("character")
check<Byte>("byte")
check<Short>("short")
check<Int>("integer")
check<Float>("float")
check<Long>("long")
check<Double>("double")
check<String>("String")
check<java.lang.Void>("Void")
return "OK"
}