Provide JvmSynthetic annotation in stdlib-common as optional

#KT-24478
This commit is contained in:
Ilya Gorbunov
2018-08-21 18:51:35 +03:00
parent 0c89996e34
commit 36f154882c
2 changed files with 14 additions and 1 deletions
@@ -64,6 +64,19 @@ public expect annotation class JvmMultifileClass()
@OptionalExpectation
public expect annotation class JvmField()
/**
* Sets `ACC_SYNTHETIC` flag on the annotated target in the Java bytecode.
*
* Synthetic targets become inaccessible for Java sources at compile time while still being accessible for Kotlin sources.
* Marking target as synthetic is a binary compatible change, already compiled Java code will be able to access such target.
*
* This annotation is intended for *rare cases* when API designer needs to hide Kotlin-specific target from Java API
* while keeping it a part of Kotlin API so the resulting API is idiomatic for both languages.
*/
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.FIELD)
@OptionalExpectation
public expect annotation class JvmSynthetic()
/**
* Instructs compiler to generate or omit wildcards for type arguments corresponding to parameters with
* declaration-site variance, for example such as `Collection<out T>` has.
@@ -76,7 +76,7 @@ internal annotation class JvmPackageName(val name: String)
*/
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.FIELD)
@Retention(AnnotationRetention.SOURCE)
public annotation class JvmSynthetic
public actual annotation class JvmSynthetic
/**
* This annotation indicates what exceptions should be declared by a function when compiled to a JVM method.