[Wasm] Fix js interop closure signature
Before we used IrType.render() which is not unique. This changes adds a proper serialization of adapter signature to string.
This commit is contained in:
committed by
Space Team
parent
e99b453816
commit
1b7c63bd49
@@ -0,0 +1,11 @@
|
||||
// TARGET_BACKEND: WASM
|
||||
|
||||
// Type of functions `(T) -> T` are rendered the same way in IrType::render
|
||||
fun <T : JsAny?> foo(f: (T) -> T, x: Int): Int = js("f(x)")
|
||||
fun <T : JsAny?> foo(f: (T) -> T, x: String): String = js("f(x)")
|
||||
|
||||
fun box(): String {
|
||||
if (foo<JsAny>({ it }, 10) != 10) return "Fail 1"
|
||||
if (foo<JsAny>({ it }, "20") != "20") return "Fail 2"
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user