Ido Flax
01/13/2025, 6:01 AM[NON_EXPORTABLE_TYPE] Exported declaration uses non-exportable return type 'kotlin. js. Promise<*>'.
for the following 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 exportableNick Lunyak
01/13/2025, 1:05 PM@JsExport
. Filed: KT-74389