I want to generate a hidden (from Kotlin callers) constructor. On the JVM I'd like it to be synthetic and on other platforms it could be deprecated with HIDDEN warning I suppose. What's my options generating such a constructor? Should I just add
@JvmSynthetic
and the
@Deprecated
annotations?
ansman
04/02/2024, 1:43 AM
Looks like adding
JvmSynthetic
works at least. Nice
e
edrd
04/02/2024, 2:15 PM
The doc says:
Synthetic targets become inaccessible for Java sources at compile time while still being accessible for Kotlin sources.
Are you sure it’s working because of
JvmSynthetic
? Isn’t it because of the
@Deprecated
?
(asking out of curiosity — I have this use case too)
a
ansman
04/02/2024, 2:15 PM
I haven't added
@Deprecated
yet so it couldn't be it
ansman
04/02/2024, 2:16 PM
I'm having trouble adding the deprecated in fact because I don't know how to set the level, trying to figure out how to get an