ContextFunctionTypeParams

Common
JVM
JS
Native
1.7
@Target([AnnotationTarget.TYPE]) annotation class ContextFunctionTypeParams
(source)

Signifies that the annotated functional type has the prefix of size count for context receivers. Thus, @ContextFunctionTypeParams(2) @ExtensionFunctionType Function4<String, Int, Double, Byte, Unit> is a normalized representation of context(String, Int) Double.(Byte) -> Unit.

Just the same as @ExtensionFunctionType, this annotation is not assumed to be used in source code, preferring the explicit function type syntax, like in the example above.

There's no need in any additional opt-in limitations because this annotation might only be referenced by users who turned on an experimental -Xcontext-receivers compiler flag, for which there are no backward/forward compatibilities guarantees.

Constructors

Common
JVM
JS
Native
1.0

<init>

Signifies that the annotated functional type has the prefix of size count for context receivers. Thus, @ContextFunctionTypeParams(2) @ExtensionFunctionType Function4<String, Int, Double, Byte, Unit> is a normalized representation of context(String, Int) Double.(Byte) -> Unit.

<init>(count: Int)

Properties

Common
JVM
JS
Native
1.0

count

val count: Int

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>