Skip to content

KaSimpleCall

Represents a successful resolution resulting in a simple call.

Example

class Foo {
   fun function() {}
}

fun Foo.usage() {
   function()
}

function() call will be represented as a KaSimpleCall

See also

Inheritors

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.

constructor

this call as a call to a constructor, or null if it is not a constructor call.

Example

annotation class Anno

class Foo

@Anno
fun usage() {
   Foo()
}

Both the Foo() call and the @Anno annotation entry are constructor calls, so constructor returns the call itself.

See also

contextArguments

The list of context parameters for this symbol access. The list is available if the callable is declared with context parameters.

dispatchReceiver

The dispatch receiver for this symbol access. A dispatch receiver is available if the callable is declared inside a class or object.

extensionReceiver

The extension receiver for this symbol access. An extension receiver is available if the callable is declared with an extension receiver.

function

this call as a KaFunctionCall, or null if it is not a call to a function.

Example

class Foo {
   fun function() {}
   var int: Int = 1
}

fun Foo.usage() {
   function()
   int
}

For function(), function is the call to function. For int, which is a KaVariableAccessCall, function is null.

See also

signature

abstract val signature: C

The function or variable declaration.

simple

this call as a KaSimpleCall, or null if it is a KaMultiCall.

Example

var int: Int = 1

fun usage() {
   int = 2
   int++
}

For int = 2, simple is the write access to int. For int++, which is a KaMultiCall, simple is null.

See also

symbol

The callable symbol which the KaPartiallyAppliedSymbol represents. While the information contained in a partially applied symbol is not exhaustive (e.g. applied functions are missing value arguments), the symbol of the callable which is called is definite.

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.

typeArgumentsMapping

A map of inferred type arguments. If type placeholders were used, the actual inferred type will be used as a value. The keys for this map are from signature's type parameters.

In case of a resolution or inference error, the map might be empty.

variable

this call as a KaVariableAccessCall, or null if it is not an access to a variable.

Example

class Foo {
   fun function() {}
   var int: Int = 1
}

fun Foo.usage() {
   int
   function()
}

For int, variable is the read access to int. For function(), which is a KaFunctionCall, variable is null.

See also

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.