W3cubDocs

/Kotlin 1.9

ContextFunctionTypeParams

Platform and version requirements: JVM (1.7), JS (1.7), Native (1.7)
@Target([AnnotationTarget.TYPE]) annotation class ContextFunctionTypeParams

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

Platform and version requirements: JVM (1.0), JS (1.0), 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

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)

count

val count: Int

Extension Properties

Platform and version requirements: JVM (1.0)

annotationClass

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

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

© 2010–2023 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-context-function-type-params/index.html