Hello in the context of kotlin/js Switching to k2 ...
# compiler
i
Hello in the context of kotlin/js Switching to k2 compiler brings up the following error:
Copy code
[NON_EXPORTABLE_TYPE] Exported declaration uses non-exportable return type 'kotlin. js. Promise<*>'.
for the following code:
Copy code
fun foo(): Promise<*> = ...
When with the non k2 compiler, this doesn’t happen With the non k2 compiler,
Promise<Unit>
isn’t exportable, which is why i’m using
Promise<*>
Interestingly though, this isn’t always the case, and sometimes i don’t get a warning for
Promise<Unit>
, when the return type is inferred and not explicit. I can’t prove it now, but i’ve seen this happen So I cannot use the k2 mode right now it seems in any case, I’m curious as to why Promise<Unit> isn’t exportable
n
Hello! Thank you for the report, I can confirm there's an inconsistency in which types are considered exportable, both between K1 and K2 and between K1 and the documentation for
@JsExport
. Filed: KT-74389
👍 1