Skip to content

KaErrorCallInfo

An erroneous call. The candidateCalls and diagnostic can be used to further analyze the error.

Properties

calls

The list of KaCalls associated with the KaCallInfo. The list contains a single KaCall in case of a successful call, but may contain multiple candidates in case of an error call.

The flattened list of resolved calls.

The flattened list of KaSimpleCalls.

candidateCalls

abstract val candidateCalls: List<KaCall>

A list of KaCalls to candidates that were considered during the call resolution process, but ultimately not selected. This may be due to various errors. For example, an ambiguity results in an error call with multiple candidates.

An error call is not guaranteed to have any candidates.

diagnostic

abstract val diagnostic: KaDiagnostic

The KaDiagnostic describing the error.

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.

singleCallOrNull

inline fun <reified T : KaCall> KaCallInfo.singleCallOrNull(): T?

Returns the single KaCall of type T associated with the KaCallInfo, or null if there is no such exact single call.

In the case of an error call, returns a single candidate call of type T.

singleConstructorCallOrNull

Returns the single KaFunctionCall with a KaConstructorSymbol associated with the KaCallInfo, or null if there is no such exact single call.

See also

singleFunctionCallOrNull

Returns the single KaFunctionCall associated with the KaCallInfo, or null if there is no such exact single call.

See also

singleVariableAccessCall

Returns the single KaVariableAccessCall associated with the KaCallInfo, or null if there is no such exact single call.

See also

successfulCallOrNull

inline fun <reified T : KaCall> KaCallInfo.successfulCallOrNull(): T?

Returns the successful KaCall of type T associated with the KaCallInfo, or null if there is no such exact call (either the call is not successful, or the successful call is of another type).

successfulConstructorCallOrNull

Returns the successful KaFunctionCall with a KaConstructorSymbol associated with the KaCallInfo, or null if there is no such exact call.

See also

successfulFunctionCallOrNull

Returns the successful KaFunctionCall associated with the KaCallInfo, or null if there is no such exact call.

See also

successfulVariableAccessCall

Returns the successful KaVariableAccessCall associated with the KaCallInfo, or null if there is no such exact call.

See also

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.