Platform and version requirements: JVM (1.0), JS (1.1), Native (1.3)
interface Annotation
Platform and version requirements: JVM (1.3), JS (1.3), Native (1.3)
Allows to infer generic type arguments of a function from the calls in the annotated function parameter of that function.
annotation class BuilderInference
Platform and version requirements: Native (1.3)
Platform and version requirements: Native (1.3)
Makes top level function available from C/C++ code with the given name.
Platform and version requirements: Native (1.3)
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
Marks the annotated declaration as deprecated.
annotation class Deprecated
Platform and version requirements: JVM (1.1), JS (1.1), Native (1.1)
When applied to annotation class X specifies that X defines a DSL language
annotation class DslMarker
Platform and version requirements: JVM (1.2), JS (1.2), Native (1.2)
Signals that the annotated annotation class is a marker of an experimental API.
annotation class Experimental
Platform and version requirements: JVM (1.3), JS (1.3), Native (1.3)
This marker distinguishes the experimental contract declaration API and is used to opt-in for that feature when declaring contracts of user functions.
annotation class ExperimentalContracts
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
The experimental multiplatform support API marker.
annotation class ExperimentalMultiplatform
Platform and version requirements: JVM (1.3), JS (1.3), Native (1.3)
This annotation marks the standard library API that is considered experimental and is not subject to the general compatibility guarantees given for the standard library: the behavior of such API may be changed or the API may be removed completely in any further release.
annotation class ExperimentalStdlibApi
Platform and version requirements: JVM (1.3), JS (1.3), Native (1.3)
The experimental marker for type inference augmenting annotations.
annotation class ExperimentalTypeInference
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
Marks the API that is dependent on the experimental unsigned types, including those types themselves.
annotation class ExperimentalUnsignedTypes
Platform and version requirements: Native (1.3)
Makes Kotlin subclass of Objective-C class visible for runtime lookup after Kotlin main
function gets invoked.
annotation class ExportObjCClass
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
Signifies that the annotated functional type represents an extension function.
annotation class ExtensionFunctionType
Platform and version requirements: Native (1.3)
annotation class ExternalObjCClass
Platform and version requirements: Native (1.3)
annotation class InteropStubs
Platform and version requirements: JS (1.1)
Denotes an external
declaration that must be imported from native JavaScript library.
annotation class JsModule
Platform and version requirements: JS (1.0)
Gives a declaration (a function, a property or a class) specific name in JavaScript.
Platform and version requirements: JS (1.1)
Denotes an external
declaration that can be used without module system.
annotation class JsNonModule
Platform and version requirements: JS (1.1)
Adds prefix to external
declarations in a source file.
annotation class JsQualifier
Platform and version requirements: JVM (1.2)
Specifies that a JVM default method should be generated for non-abstract Kotlin interface member.
annotation class JvmDefault
Platform and version requirements: JVM (1.0)
Instructs the Kotlin compiler not to generate getters/setters for this property and expose it as a field.
annotation class JvmField
Platform and version requirements: JVM (1.0)
Instructs the Kotlin compiler to generate a multifile class with top-level functions and properties declared in this file as one of its parts. Name of the corresponding multifile class is provided by the JvmName annotation.
annotation class JvmMultifileClass
Platform and version requirements: JVM (1.0)
Specifies the name for the Java class or method which is generated from this element.
Platform and version requirements: JVM (1.0)
Instructs the Kotlin compiler to generate overloads for this function that substitute default parameter values.
annotation class JvmOverloads
Platform and version requirements: JVM (1.0)
Specifies that an additional static method needs to be generated from this element if it's a function. If this element is a property, additional static getter/setter methods should be generated.
annotation class JvmStatic
Platform and version requirements: JVM (1.0)
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.
annotation class JvmSuppressWildcards
Platform and version requirements: JVM (1.0)
Sets ACC_SYNTHETIC
flag on the annotated target in the Java bytecode.
annotation class JvmSynthetic
Platform and version requirements: JVM (1.0)
Instructs compiler to generate wildcard for annotated type arguments corresponding to parameters with declaration-site variance.
annotation class JvmWildcard
Platform and version requirements: JVM (1.3)
This annotation is present on any class file produced by the Kotlin compiler and is read by the compiler and reflection. Parameters have very short JVM names on purpose: these names appear in all generated class files, and we'd like to reduce their size.
annotation class Metadata
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
This meta-annotation determines that an annotation is a part of public API and therefore should be included in the generated documentation for the element to which the annotation is applied.
annotation class MustBeDocumented
Platform and version requirements: JS (1.1)
Platform and version requirements: JS (1.1)
annotation class nativeGetter
Platform and version requirements: JS (1.1)
annotation class nativeInvoke
Platform and version requirements: JS (1.1)
annotation class nativeSetter
Platform and version requirements: Native (1.3)
Makes Kotlin method in Objective-C class accessible through Objective-C dispatch to be used as action sent by control in UIKit or AppKit.
annotation class ObjCAction
Platform and version requirements: Native (1.3)
annotation class ObjCConstructor
Platform and version requirements: Native (1.3)
annotation class ObjCFactory
Platform and version requirements: Native (1.3)
annotation class ObjCMethod
Platform and version requirements: Native (1.3)
Makes Kotlin property in Objective-C class settable through Objective-C dispatch to be used as IB outlet.
annotation class ObjCOutlet
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
Marks an expected annotation class that it isn't required to have actual counterparts in all platforms.
annotation class OptionalExpectation
Platform and version requirements: JVM (1.1), JS (1.1), Native (1.1)
Annotates type arguments of functional type and holds corresponding parameter name specified by the user in type declaration (if any).
annotation class ParameterName
Platform and version requirements: JVM (1.1), JS (1.1), Native (1.1)
When applied to a class or a member with internal visibility allows to use it from public inline functions and makes it effectively public.
annotation class PublishedApi
Platform and version requirements: JVM (1.0)
Instructs the Kotlin compiler to treat annotated Java class as pure implementation of given Kotlin interface. "Pure" means here that each type parameter of class becomes non-platform type argument of that interface.
annotation class PurelyImplements
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
This meta-annotation determines that an annotation is applicable twice or more on a single code element
annotation class Repeatable
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
Specifies a code fragment that can be used to replace a deprecated function, property or class. Tools such as IDEs can automatically apply the replacements specified through this annotation.
annotation class ReplaceWith
Platform and version requirements: JVM (1.3), JS (1.3), Native (1.3)
Classes and interfaces marked with this annotation are restricted when used as receivers for extension suspend
functions. These suspend
extensions can only invoke other member or extension suspend
functions on this particular receiver and are restricted from calling arbitrary suspension functions.
annotation class RestrictsSuspension
Platform and version requirements: JVM (1.1), JS (1.1), Native (1.1)
Classes and interfaces marked with this annotation are restricted when used as receivers for extension suspend
functions. These suspend
extensions can only invoke other member or extension suspend
functions on this particular receiver only and are restricted from calling arbitrary suspension functions.
annotation class RestrictsSuspension
Platform and version requirements: Native (1.3)
Preserve the function entry point during global optimizations.
Platform and version requirements: Native (1.3)
Preserve the function entry point during global optimizations, only for the given target.
annotation class RetainForTarget
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
This meta-annotation determines whether an annotation is stored in binary output and visible for reflection. By default, both are true.
annotation class Retention
Platform and version requirements: Native (1.0)
Marks a top level variable with a backing field or an object as immutable. It is possible to share such object between multiple threads, but it becomes deeply frozen, so no changes can be made to its state or the state of objects it refers to.
annotation class SharedImmutable
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
Specifies the first version of Kotlin where a declaration has appeared. Using the declaration and specifying an older API version (via the -api-version
command line option) will result in an error.
annotation class SinceKotlin
Platform and version requirements: JVM (1.0)
Marks the JVM method generated from the annotated function as strictfp
, meaning that the precision of floating point operations performed inside the method needs to be restricted in order to achieve better portability.
annotation class Strictfp
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
Suppresses the given compilation warnings in the annotated element.
annotation class Suppress
Platform and version requirements: Native (1.3)
Forces the compiler to use specified symbol name for the target external
function.
annotation class SymbolName
Platform and version requirements: JVM (1.0), JS (1.0)
Marks the JVM method generated from the annotated function as synchronized
, meaning that the method will be protected from concurrent execution by multiple threads by the monitor of the instance (or, for static methods, the class) on which the method is defined.
annotation class Synchronized
Platform and version requirements: JS (1.1)
typealias Synchronized = Synchronized
Platform and version requirements: Native (1.3)
annotation class Synchronized
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
This meta-annotation indicates the kinds of code elements which are possible targets of an annotation.
Platform and version requirements: Native (1.0)
Marks a top level variable with a backing field or an object as thread local. The object remains mutable and it is possible to change its state, but every thread will have a distinct copy of this object, so changes in one thread are not reflected in another.
annotation class ThreadLocal
Platform and version requirements: JVM (1.0)
This annotation indicates what exceptions should be declared by a function when compiled to a JVM method.
Platform and version requirements: Native (1.3)
This annotation indicates what exceptions should be declared by a function when compiled to a platform method.
Platform and version requirements: JVM (1.0)
Marks the JVM backing field of the annotated property as transient
, meaning that it is not part of the default serialized form of the object.
annotation class Transient
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
Suppresses errors about variance conflict
annotation class UnsafeVariance
Platform and version requirements: JVM (1.2), JS (1.2), Native (1.2)
Allows to use experimental API denoted by the given markers in the annotated file, declaration, or expression. If a declaration is annotated with UseExperimental, its usages are not required to opt-in to that experimental API.
annotation class UseExperimental
Platform and version requirements: JVM (1.0), JS (1.0)
Marks the JVM backing field of the annotated property as volatile
, meaning that writes to this field are immediately made visible to other threads.
annotation class Volatile
Platform and version requirements: JS (1.1)
typealias Volatile = Volatile
Platform and version requirements: Native (1.3)
annotation class Volatile