Files
kotlin/compiler/testData/codegen/box/traits/interfaceWithNonAbstractFunIndirectGeneric.kt
Alexey Andreev 4252d9786b Fix translation of interface with non-abstract methods in JS BE
Fix additional case of generic interfaces in KT-18187
2017-06-08 13:51:18 +03:00

27 lines
545 B
Kotlin
Vendored

interface I<T> {
fun foo(x: T): String = "foo($x)"
fun bar(x: T, y: String = "default") = "bar($x,$y)"
}
interface J : I<String>
class A : I<String>, J
class B : J, I<String>
fun box(): String {
val foo = A().foo("q")
if (foo != "foo(q)") return "fail1: $foo"
val bar1 = A().bar("w")
if (bar1 != "bar(w,default)") return "fail2: $bar1"
val bar2 = A().bar("e", "r")
if (bar2 != "bar(e,r)") return "fail3: $bar2"
val foo2 = B().foo("t")
if (foo2 != "foo(t)") return "fail4: $foo2"
return "OK"
}