28 lines
497 B
Kotlin
Vendored
28 lines
497 B
Kotlin
Vendored
// TARGET_BACKEND: JVM
|
|
// FULL_JDK
|
|
// WITH_RUNTIME
|
|
// IGNORE_BACKEND: ANDROID
|
|
// SKIP_JDK6
|
|
// FILE: 1.kt
|
|
|
|
package test
|
|
import java.lang.reflect.*
|
|
|
|
class OK
|
|
|
|
interface S<A>
|
|
|
|
inline fun <reified T : Any> test(): String {
|
|
return (object : S<T> {
|
|
|
|
}::class.java.genericInterfaces[0] as ParameterizedType).actualTypeArguments[0].getTypeName()
|
|
}
|
|
|
|
// FILE: 2.kt
|
|
import test.*
|
|
|
|
fun box():String {
|
|
val test = test<OK>()
|
|
return if (test == OK::class.qualifiedName) "OK" else "fail: $test"
|
|
}
|