[K/JS] Use only single variant of default arguments function wrapper for exported and not-exported functions

This commit is contained in:
Artem Kobzar
2022-09-19 17:49:04 +00:00
committed by Space
parent ea7ce55082
commit 73e7053c35
59 changed files with 1109 additions and 597 deletions
@@ -0,0 +1,28 @@
// EXPECTED_REACHABLE_NODES: 1299
package foo
interface A {
open fun foo(x: Int = 20, y: Int = 3) = x + y
}
open class B : A {
override fun foo(x: Int, y: Int) = 0
fun bar1() = super.foo()
fun bar2() = super.foo(30)
fun bar3() = super.foo(y = 4)
}
fun box(): String {
val v1 = B().bar1()
if (v1 != 23) return "fail1: $v1"
val v2 = B().bar2()
if (v2 != 33) return "fail2: $v2"
val v3 = B().bar3()
if (v3 != 24) return "fail3: $v3"
return "OK"
}