Add test for class literals on inline classes

#KT-28361 Obsolete
This commit is contained in:
Mikhail Zarechenskiy
2018-11-22 11:17:33 +03:00
parent 7a9fb3ca26
commit b48614df47
5 changed files with 92 additions and 0 deletions
@@ -13,6 +13,10 @@ fun check(c: Class<*>, s: String) {
if (c.toString() != s) error("Fail, expected: $s, actual: $c")
}
inline fun <reified T> reifiedCheck(asString: String) {
check(T::class.java, asString)
}
fun box(): String {
val i = IcInt(0)
val l = IcLong(0)
@@ -31,6 +35,12 @@ fun box(): String {
check(o::class.java, "class root.IcOverIc")
check(1u::class.java, "class kotlin.UInt")
reifiedCheck<IcInt>("class root.IcInt")
reifiedCheck<IcLong>("class root.IcLong")
reifiedCheck<IcAny>("class root.IcAny")
reifiedCheck<IcOverIc>("class root.IcOverIc")
reifiedCheck<UInt>("class kotlin.UInt")
val arrI = arrayOf(i)
check(arrI[0].javaClass, "class root.IcInt")