Skip to content

KaSubstitutorBuilder

Properties

mappings

A map of the type substitutions that have so far been accumulated by the builder.

token

abstract val token: KaLifetimeToken

The KaLifetimeToken which determines the lifetime of the lifetime owner.

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.

substitution

abstract fun substitution(typeParameter: KaTypeParameterSymbol, type: KaType)

Adds a new typeParameter ->type substitution to the substitutor.

If there already was a substitution with a typeParameter, the function replaces the corresponding substitution with a new one.

substitutions

abstract fun substitutions(substitutions: Map<KaTypeParameterSymbol, KaType>)

Adds new KaTypeParameterSymbol ->KaType substitutions to the substitutor.

If there already was a substitution with a KaTypeParameterSymbol, the function replaces the corresponding substitution with a new one.

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.