Title
r

rogeralsing

07/28/2017, 10:35 AM
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

diesieben07

07/28/2017, 10:47 AM
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

rogeralsing

07/28/2017, 10:53 AM
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

diesieben07

07/28/2017, 10:53 AM
Well, suspending funcs can produce a CompletableFuture, so you do not necessarily have to write a complete wrapper.
r

rogeralsing

07/28/2017, 10:55 AM
I'm not following, let's say I have a func taking a suspended lambda.. how would you interact with that from Java?
d

diesieben07

07/28/2017, 11:38 AM
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

elizarov

07/28/2017, 1:28 PM
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