[JS IR] Add test on interface with default method calling extension method on super-interface

^KT-42176 fixed
This commit is contained in:
Ilya Goncharov
2021-01-18 18:24:19 +03:00
parent 5c28762c02
commit 50ab9ed054
10 changed files with 130 additions and 0 deletions
@@ -0,0 +1,22 @@
// KT-42176
interface Top<D>{
fun getData(): D
fun toString(data: D): String
}
fun <D> Top<D>.getString() = toString(getData())
interface DefaultImpl: Top<Int>{
override fun toString(data: Int): String = data.toString()
}
class Bottom(val data: Int): DefaultImpl {
override fun getData(): Int = data
}
fun box(): String {
val bottom = Bottom(10).getString()
if (bottom != "10") return "fail: $bottom"
return "OK"
}