JvmSynthetic

Common
JVM
1.0
@Target([AnnotationTarget.FILE, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.FIELD]) annotation class JvmSynthetic
(Common source) (JVM source)

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.

Constructors

Common
JVM
1.0

<init>

Sets ACC_SYNTHETIC flag on the annotated target in the Java bytecode.

<init>()

Extension Properties

JVM
1.0

annotationClass

Returns a KClass instance corresponding to the annotation type of this annotation.

val <T : Annotation> T.annotationClass: KClass<out T>