hasAnnotations

Indicates that the corresponding class has at least one annotation.

This flag is useful for reading Kotlin metadata on JVM efficiently. On JVM, most of the annotations are written not to the Kotlin metadata, but directly to the corresponding declarations in the class file. This flag can be used as an optimization to avoid reading annotations from the class file (which can be slow) in case when a class has no annotations.

Only annotations with AnnotationRetention.BINARY and AnnotationRetention.RUNTIME are written to the class files.


Indicates that the corresponding constructor has at least one annotation.

This flag is useful for reading Kotlin metadata on JVM efficiently. On JVM, most of the annotations are written not to the Kotlin metadata, but directly to the corresponding declarations in the class file. This flag can be used as an optimization to avoid reading annotations from the class file (which can be slow) in case when a constructor has no annotations.

Only annotations with AnnotationRetention.BINARY and AnnotationRetention.RUNTIME are written to the class files.


Indicates that the corresponding function has at least one annotation.

This flag is useful for reading Kotlin metadata on JVM efficiently. On JVM, most of the annotations are written not to the Kotlin metadata, but directly to the corresponding declarations in the class file. This flag can be used as an optimization to avoid reading annotations from the class file (which can be slow) in case when a function has no annotations.

Only annotations with AnnotationRetention.BINARY and AnnotationRetention.RUNTIME are written to the class files.


Indicates that the corresponding property has at least one annotation.

This flag is useful for reading Kotlin metadata on JVM efficiently. On JVM, most of the annotations are written not to the Kotlin metadata, but directly to the corresponding declarations in the class file. This flag can be used as an optimization to avoid reading annotations from the class file (which can be slow) in case when a property has no annotations.

Only annotations with AnnotationRetention.BINARY and AnnotationRetention.RUNTIME are written to the class files.


Indicates that the corresponding property accessor has at least one annotation.

This flag is useful for reading Kotlin metadata on JVM efficiently. On JVM, most of the annotations are written not to the Kotlin metadata, but directly to the corresponding declarations in the class file. This flag can be used as an optimization to avoid reading annotations from the class file (which can be slow) in case when a property accessor has no annotations.

Only annotations with AnnotationRetention.BINARY and AnnotationRetention.RUNTIME are written to the class files.


Indicates that the corresponding value parameter has at least one annotation.

This flag is useful for reading Kotlin metadata on JVM efficiently. On JVM, most of the annotations are written not to the Kotlin metadata, but directly to the corresponding declarations in the class file. This flag can be used as an optimization to avoid reading annotations from the class file (which can be slow) in case when a value parameter has no annotations.

Only annotations with AnnotationRetention.BINARY and AnnotationRetention.RUNTIME are written to the class files.


Indicates that the corresponding type alias has at least one annotation.

Type aliases store their annotation in metadata directly (accessible via KmTypeAlias.annotations) and in the class file at the same time. As a result, Kotlin compiler still writes this flag for them, and this extension is left for completeness.

Only annotations with AnnotationRetention.BINARY and AnnotationRetention.RUNTIME are written to the class files and metadata.