Skip to content

KaClassTypeQualifier

A type qualifier is a segment in a multi-segment class type application.

Qualifiers become relevant when a type consists of multiple segments, such as Foo.Bar. Each qualifier in the list corresponds to a segment, and allows retrieving the KaClassifierSymbol (if resolved), name, and typeArguments at that position.

A type qualifier is either resolved or unresolved in case of a type error.

Example

class Foo<T> {
    inner class Bar<U> { }
}

val bar: Foo<Int>.Bar<String> = Foo<Int>().Bar<String>()

The type Foo<Int>.Bar<String> consists of two qualifiers, Foo<Int> and Bar<String>.

Inheritors

Properties

name

abstract val name: Name

token

abstract val token: KaLifetimeToken

The KaLifetimeToken which determines the lifetime of the lifetime owner.

typeArguments

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.