Files
kotlin-fork/compiler/testData/compileKotlinAgainstKotlin/recursiveGeneric.kt
T
Ilya Matveev a5e4e0284e Mute some box tests for native backend
This patch mutes the following test categories:
   * Tests with java dependencies (System class,
     java stdlib, jvm-oriented annotations etc).
   * Coroutines tests.
   * Reflection tests.
   * Tests with an inheritance from the standard
     collections.
2017-03-10 19:59:37 +03:00

28 lines
543 B
Kotlin
Vendored

// IGNORE_BACKEND: NATIVE
// FILE: A.kt
package a
interface Rec<R, out T: Rec<R, T>> {
fun t(): T
}
interface Super {
fun foo(p: Rec<*, *>) = p.t()
}
// FILE: B.kt
import a.*
fun box(): String {
val declaredMethod = Super::class.java.getDeclaredMethod("foo", Rec::class.java)
val genericString = declaredMethod.toGenericString()
if (genericString != "public abstract a.Rec<?, ?> a.Super.foo(a.Rec<?, ?>)") return "Fail: $genericString"
return "OK"
}
fun test(s: Super, p: Rec<*, *>) {
s.foo(p).t().t().t()
}