Kotlin Analysis API Documentation Help

KaSingleOrMultiCall

KaSingleOrMultiCall is the sealed return type of resolveCall(). The type system splits resolved calls into two shapes:

  • KaSingleCall — a single resolved callable applied at this site. Most everyday call sites (function invocations, property accesses, callable references, annotation entries, supertype calls) return this.

  • KaMultiCall — a compound or desugared expression that resolves to several sub-calls. This is what for loops, delegated properties, compound assignments (+=, ++, --), and compound array access (a[i] += v) return.

Hierarchy

KaSingleOrMultiCall

KaSingleCall

KaMultiCall

Helper extensions

Two extension properties give a uniform view across both branches:

val KaSingleOrMultiCall.calls: List<KaSingleCall<*, *>>

The flattened list of single calls. Returns listOf(this) for a KaSingleCall; returns KaMultiCall.calls for a KaMultiCall.

val KaSingleOrMultiCall.symbols: List<KaSymbol>

The flattened list of symbols across every contained KaSingleCall. Convenient when you only care about who was called and not about the call structure.

When the type system narrows the result

Many specialized resolveCall(...) methods commit to one branch in their return type:

  • KtForExpression.resolveCall(): KaForLoopCall? — always a KaMultiCall.

  • KtPropertyDelegate.resolveCall(): KaDelegatedPropertyCall? — always a KaMultiCall.

  • KtCallElement.resolveCall(): KaFunctionCall<*>? — always a KaSingleCall.

  • KtAnnotationEntry.resolveCall(): KaAnnotationCall? — always a KaSingleCall.

The generic KtResolvableCall.resolveCall(): KaSingleOrMultiCall? is the broadest return type, useful when the PSI type is unknown.

19 May 2026