https://kotlinlang.org logo
Title
s

SOFe

02/23/2019, 10:06 AM
Is it possible to export a Kotlin function in the
exports
of
WebAssembly.Instance
? I have tried using
@SymbolName
on the functions I want to export, but it's not showing up in the exports object
s

sergey.bogolepov

02/25/2019, 9:30 AM
There is no stable API for it yet. For now you can use
@Retain
annotation. Please note that name of the exported function will be mangled (
kfun:...
).
s

SOFe

02/25/2019, 10:12 AM
Thanks a lot! Can't believe I missed it. It's right above the declaration of
@SymbolName
in the .knm includes 🙈
hmm, it's still not in the exports
at least nothing I can identify. There are some
kfun:
declarations in the firefox disassembly, but nothing containing my package name
and nothing
kfun:
that is exported
Are there other special requirements?
oh never mind, I forgot to set it back to NativeOutputKind.EXECUTABLE