Fleshgrinder
02/07/2020, 4:46 PM@JvmSynthetic
to hide Kotlin functions from Java users, however, we have no equivalent @JvmOnly
(or whatever it would be named) to hide definitions from Kotlin. I tried @Deprecated("Java only", level = HIDDEN)
but it's hidden in Java afterwards as well if you use IntelliJ. 😛 Any known workarounds for this or is a feature request the only possible thing?jw
02/07/2020, 4:49 PMFleshgrinder
02/07/2020, 4:50 PMFleshgrinder
02/07/2020, 4:50 PMFleshgrinder
02/07/2020, 4:53 PM@Suppress("ILLEGAL_KOTLIN_VERSION_STRING_VALUE")
@SinceKotlin("Java only")
Seems to be clearer, the suppression can be added as @file:
too.Mike
02/07/2020, 5:08 PM@JvmOnlyJava
Otherwise, I'd also use the "Java only" version approach.
I know it's unlikely this code will still be around when Kotlin 99999 is released, but...Fleshgrinder
02/07/2020, 5:16 PM@SinceKotlin
annotation is not inheritable. Meaning, if I create a @JavaOnly
annotation I cannot give it the same semantics as @SinceKotlin("Java only")
has it and the symbol will be visible in both Java and Kotlin. 😞 I'll create a feature request and PR for Kotlin, we need this. Maybe something like @PlatformOnly
since it might be useful for JS and native too.Fleshgrinder
02/07/2020, 5:39 PM@SinceKotlin("Java only")
but the symbols are still visible, it has to be @SinceKotlin("999999.999999")
or similar (so a version string). 😞 I guess the only workaround here is to create a constant that says JAVA_ONLY
and contains such a weird number.Mike
02/07/2020, 6:59 PMFleshgrinder
02/08/2020, 9:55 AMmarstran
02/10/2020, 10:54 AMFleshgrinder
02/10/2020, 11:09 AM