Is there something like `@JvmSynthetic` in K/JS?
# javascript
a
Is there something like
@JvmSynthetic
in K/JS?
Or something to mark a function to not be with
@JsExport
?
(sort of?)
t
internal
?
a
No, not to be internal for Kotlin actually
t
Do you create this class inside only?
a
Kotlin?
t
You can use
Proxy
, If you create instances only inside Kotlin
a
No not that way, I was talking about not exporting some functions from a class.
Marking @JvmSyntheic on functions makes it non callable from Java (usecase includes suspending ones)
t
What about
inline
or extension methods They will have such “effect”
a
Extension functions are good, but ... 😅
Isn't there something like @JsSynthetic?
I was expecting I could make a IR plugin, which can make things like suspend functions hidden from
@JsExport
and make stubs for it automatically that are interoperable.
idk if its viable, but that was the primary goal*
t
You can mark those methods as
private
via plugin 🙂
👀 1
a
That'd make them private from kotlin side as well? No?
t
No 🙂
😮 1
K 1
a
Tysm!
Oh wait no, I mean like, if it is going to be library, it wouldn't seen private, but as public from Kotlin end? 😮
t
You can do this trick for apps only
AFAIK
@JsExport
works for current subproject only
🤔 1
And
suspend
function musn’t be exported
It looks like a bug
a
how about
fun abcd(param: suspend () -> Unit)
?
That's also not exported?
It looks like a bug
Havent matched exactly, but I guess they were, have to recheck.
t
suspend
- Kotlin specific, which must be hidden (and mangled)
Issue required 🙂