Skip to content

KaFunctionValueParameter

Represents a function value parameter

Constructors

KaFunctionValueParameter

constructor()

Properties

name

abstract val name: Name?

Name of the parameter, as specified in the function signature.

Note that some parameters might not have names by their nature. This applies to, for example, receiver parameters in references to member functions.

class A {
    fun foo(x: Int) {}
}

val fooRef = A::foo

fooRef from the example above has KaFunctionType. This type has two KaFunctionValueParameters:

  • One receiver parameter of type A, which doesn't have any specified name

  • One regular parameter x of type Int

token

abstract val token: KaLifetimeToken

The KaLifetimeToken which determines the lifetime of the lifetime owner.

type

abstract val type: KaType

Type of the parameter

Functions

assertIsValidAndAccessible

isValid

Whether the lifetime owner is still valid, i.e. we are still in the scope of the lifetime owner's regular lifetime.

withValidityAssertion

inline fun <R> KaLifetimeOwner.withValidityAssertion(action: () -> R): R

Executes action only if the KaLifetimeOwner is still valid and accessible. Otherwise, throws a validity exception based on the concrete violation.