Skip to content

KaCompoundSymbolResolutionError

Represents a failed resolution of a compound (multi) call at the symbol level.

This type is produced only when a compound call has a mix of successful and failed sub-calls, or when all sub-calls fail. The simpleAttempts list contains:

When all sub-calls succeed, KaSimpleSymbolResolutionSuccess is returned instead. When a simple call fails, KaSimpleSymbolResolutionError is returned instead.

Unlike KaMultiCallResolutionAttempt, this type does not distinguish between specific compound call kinds (for-loop, delegated property, etc.) — it simply holds a flat list of sub-call resolution attempts.

See also

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 list of individual resolution attempts for each sub-call.

Contains at most one KaSimpleSymbolResolutionSuccess and at least one KaSimpleSymbolResolutionError. At least two entries in total.

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.