mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 08:31:30 +00:00
Merge boxWithStdlib testData into box, delete BoxWithStdlib test
This commit is contained in:
committed by
Alexander Udalov
parent
22bfc9786a
commit
06a67e6602
26
compiler/testData/codegen/box/reflection/javaProperties/javaReified.kt
vendored
Normal file
26
compiler/testData/codegen/box/reflection/javaProperties/javaReified.kt
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
// 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"
|
||||
}
|
||||
Reference in New Issue
Block a user