[K/JS] Implement file merging for clashed file during per-file compilation

This commit is contained in:
Artem Kobzar
2023-09-14 13:14:15 +00:00
committed by Space Team
parent 337054ba92
commit 878452bd2b
43 changed files with 529 additions and 277 deletions
@@ -0,0 +1,35 @@
// DONT_TARGET_EXACT_BACKEND: JS
// ES_MODULES
// MODULE: name_clash
// FILE: test1/lib.kt
package foo
@JsExport
open class A<T> {
open fun foo(value: T): T = value
}
// FILE: test2/lib.kt
package foo
@JsExport
class B: A<String>() {
override fun foo(value: String): String = value
}
// FILE: entry.mjs
// ENTRY_ES_MODULE
import { A, B } from "./fileNameClash-name_clash_v5.mjs";
export function box() {
var a = new A()
var aFoo = a.foo("ok")
if (aFoo != "ok") return "fail 1"
var b = new B()
var bFoo = b.foo("ok")
if (bFoo != "ok") return "fail 2"
return "OK"
}