Files
kotlin/compiler/testData/codegen/boxWithStdlib/reflection/javaProperties/javaReified.kt
2015-12-15 16:18:31 +03:00

25 lines
561 B
Kotlin
Vendored

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"
}