Files
kotlin-fork/compiler/testData/compileKotlinAgainstKotlin/recursiveGeneric.kt
T
Alexander Udalov 9f67fe2fe3 Adapt CompileKotlinAgainstKotlin test to black box format
Rename/remove some obsolete test cases
2016-03-02 15:47:35 +03:00

27 lines
517 B
Kotlin
Vendored

// 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()
}