Skip to content

KaSymbolResolutionAttempt

Properties

errors

The list of errors that occurred during the resolution.

The list is empty if and only if the resolution succeeded. So, unlike a this is KaSimpleCallResolutionError check, which only covers simple attempts, this property detects failures of every attempt kind.

See also

The list of errors that occurred during the resolution.

The list is empty if and only if the resolution succeeded. So, unlike a this is KaSimpleSymbolResolutionError check, which only covers simple attempts, this property detects failures of every attempt kind.

See also

isSuccessful

Whether the resolution succeeded.

true if and only if successful is not null, and equivalently if and only if errors is empty.

Unlike a this is KaSimpleCallResolutionSuccess check, which only covers simple attempts, this property also accounts for KaMultiCallResolutionAttempt, which fails as soon as any of its sub-calls fails.

See also

Whether the resolution succeeded.

true if and only if errors is empty. A KaCompoundSymbolResolutionError is always a failure, even when some of its sub-attempts succeeded.

See also

simpleAttempts

The flattened list of simple resolution attempts.

The list is never empty.

The flattened list of simple resolution attempts.

The list is never empty.

successfulSymbols

The resolved symbols if the resolution succeeded, or an empty list if it failed.

A successful resolution always has at least one symbol, so an empty list always means a failure.

See also

symbols

The flattened list of KaSymbols for the resolved calls.

A list of KaSymbol.

See also

token

abstract val token: KaLifetimeToken

The KaLifetimeToken which determines the lifetime of the lifetime owner.

Functions

assertIsValidAndAccessible

fold

inline fun <T> KaCallResolutionAttempt.fold(onSuccess: (KaSimpleOrMultiCall) -> T, onFailure: (List<KaSimpleCallResolutionError>) -> T): T

Folds over a KaCallResolutionAttempt depending on whether the resolution succeeded.

inline fun <T> KaSymbolResolutionAttempt.fold(onSuccess: (List<KaSymbol>) -> T, onFailure: (List<KaSimpleSymbolResolutionError>) -> T): T

Folds over a KaSymbolResolutionAttempt depending on whether the resolution succeeded.

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.