I use `@Suppress("EXPECTED_EXTERNAL_DECLARATION")`...
# webassembly
r
I use
@Suppress("EXPECTED_EXTERNAL_DECLARATION")
a lot to overcome K/JS and K/Wasm incompatibilities with expect/actuals. How bad is this? 🙂
s
Probably not great. Can’t confirm, but I can smell K2 issues when suppressing errors like this.
r
I'm using K2 already
s
This might work right now. But if it stops working later, Kotlin might not consider fixing it. Then, you’ll have to fix it yourself in your library and tell the people using your library to update it.
r
Is there any particular reason to forbid expecting external type?
s
None that I can think of. Could you file a ticket with the use-case so I can forward it to people working on expect-actual?
r
I think this was forbidden within this issue: https://youtrack.jetbrains.com/issue/KT-58536/KMP-prohibit-expect-tailrec-expect-external, but there is no explanation why.
I'll file a new issue
After days of struggling with common code js/wasm incompatibilities, I have found this suppress code and my project gained a lot of readability and cohesion.
s
I think you are right. A concrete YT-documented use-case from a real project would help us reconsider things.
s
Thanks 🙏
r
I'll add a link to my github code when I do some cleanups and commit.