I think I found a miscompilation/bad codegen of js...
# multiplatform
m
I think I found a miscompilation/bad codegen of js. Is there a standard way for me to debug this? Report this issue in the compiler? I tried to make a small repro project but I can't reproduce it outside my own case which is massive and closed source. Any tips?
The case btw is
Copy code
// this class is implemented on the js side
@JsExport
abstract class Adapter {
    @JsName("method")
    abstract fun method(params...., callback: (Foo) -> Unit)
}

internal class InternalService(private val adapter: Adapter) {
    suspend fun method(params...): Foo {
        suspendCoroutine { cont -> adapter.method(params) { cont.resume(it) } }
    }
}
ts-land
Copy code
class WebAdapter extends Adapter {
    override method(params..., callback: (f: Foo) -> Unit) {
        callback(makeAFoo())
    }
}
and the generated javascript calls a mangled method on that adapter inside the
InternalService
, something like
this.adapter_1.method_36nz9g_k
r
This is about the compiled JS, right? Not the TS type defs? YouTrack is the best place for this: https://youtrack.jetbrains.com/issues/KT?u=1