The @JvmSynthetic can hide Kotlin things from Java...
# announcements
r
The @JvmSynthetic can hide Kotlin things from Java. but is it possible to do the other way around? e.g. funcs that only exist to help a Java API but that shouldnt really be used from Kotlin
d
The only thing that comes to mind is naming them horribly (e.g.
___doNotCallMe
) and then correct the name with
@JvmName
. But this is a terrible hack 😄
r
My Java API has CompletableFutures while the Kotlin api has suspended funcs. so I'm not sure how to best do this w/o making the java api a complete wrapper
d
Well, suspending funcs can produce a CompletableFuture, so you do not necessarily have to write a complete wrapper.
r
I'm not following, let's say I have a func taking a suspended lambda.. how would you interact with that from Java?
d
Oh, no you can't really interact with those types of functions sensibly from Java, as far as I know. What I was referring to is that you can make use
future
instead of
async
and get a
CompletableFuture
.
e
This is great use-case for some kind of JvmAsync annotation which is explained in the comments to this issue: https://youtrack.jetbrains.com/issue/KT-17679
🎉 2