Fix translation of interface with non-abstract methods in JS BE

Fix additional case of generic interfaces in KT-18187
This commit is contained in:
Alexey Andreev
2017-06-08 12:13:25 +03:00
parent 09e4775a10
commit 4252d9786b
7 changed files with 60 additions and 7 deletions
@@ -0,0 +1,27 @@
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"
}