org.jetbrains.kotlin.analysis.api.resolution¶
Types¶
KaAnnotationCall¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaAnnotationCall : KaFunctionCall<KaConstructorSymbol>
A call to an annotation constructor.
KaApplicableCallCandidate¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaApplicableCallCandidate : KaCallCandidate
A call candidate that is applicable for a call.
KaApplicableCallCandidateInfo¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaApplicableCallCandidateInfo : KaCallCandidateInfo
A call candidate that is applicable for a call.
KaCall¶
sealed interface KaCall : KaLifetimeOwner
A call to a function, a simple/compound access to a property, or a simple/compound access through get and set convention.
KaCallableMemberCall¶
sealed interface KaCallableMemberCall<S : KaCallableSymbol, C : KaCallableSignature<S>> : KaCall
A call to a function, or a simple/compound access to a property.
KaCallableReferenceCall¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaCallableReferenceCall<S : KaCallableSymbol, C : KaCallableSignature<S>> : KaSimpleCall<S, C>
A callable reference to a function, a property, or a constructor.
KaCallCandidate¶
sealed interface KaCallCandidate : KaLifetimeOwner
KaCallCandidate represents one of the candidates considered during overload resolution of a call.
KaCallCandidateInfo¶
sealed interface KaCallCandidateInfo : KaLifetimeOwner
KaCallCandidateInfo represents one of the candidates considered during overload resolution of a call.
KaCallInfo¶
sealed interface KaCallInfo : KaLifetimeOwner
Information about a call at the call site retrieved from resolveToCall. The call may either be resolved successfully (KaSuccessCallInfo), or with errors (KaErrorCallInfo), coming with a list of candidate calls and a diagnostic.
KaCallResolutionAttempt¶
sealed interface KaCallResolutionAttempt : KaLifetimeOwner
Represents an attempt to resolve KtResolvableCall.
KaCompoundAccessCall¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaCompoundAccessCall
KaCompoundArrayAccessCall¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaCompoundArrayAccessCall : KaMultiCall, KaCall, KaCompoundAccessCall
A compound access using the array access convention, involving calls to both the get() and set() functions. For example, a[1] += "foo" is such an array compound access.
KaCompoundArrayAccessCallResolutionAttempt¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaCompoundArrayAccessCallResolutionAttempt : KaMultiCallResolutionAttempt
Represents an attempt to resolve a compound array access (e.g. a[1] += "foo" or a[0]++).
KaCompoundAssignOperation¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaCompoundAssignOperation : KaCompoundOperation
A compound assignment that reads, computes, and writes the computed value. Calls to <op>Assign are not represented by KaCompoundAssignOperation.
KaCompoundOperation¶
sealed interface KaCompoundOperation : KaLifetimeOwner
The type of compound operation applied to a variable or an array element using the array access convention.
KaCompoundSymbolResolutionError¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaCompoundSymbolResolutionError : KaSymbolResolutionAttempt
Represents a failed resolution of a compound (multi) call at the symbol level.
KaCompoundUnaryOperation¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaCompoundUnaryOperation : KaCompoundOperation
A compound unary access that reads, increments or decrements, and writes the computed value.
KaCompoundVariableAccessCall¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaCompoundVariableAccessCall : KaMultiCall, KaCall, KaCompoundAccessCall
A compound access of a mutable variable. Such accesses combine reading, modifying, and writing to the variable in a single expression, using operators like +=, -=, ++, or --.
KaCompoundVariableAccessCallResolutionAttempt¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaCompoundVariableAccessCallResolutionAttempt : KaMultiCallResolutionAttempt
Represents an attempt to resolve a compound variable access (e.g. i += 1 or i++).
KaContextSensitiveResolutionStatus¶
sealed interface KaContextSensitiveResolutionStatus
Describes how context-sensitive resolution (CSR) relates to a org.jetbrains.kotlin.psi.KtSimpleNameExpression.
KaDelegatedConstructorCall¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaDelegatedConstructorCall : KaFunctionCall<KaConstructorSymbol>
A call to another constructor within the same class, or to a superclass constructor. This corresponds to the use of this(...) or super(...) within a constructor's body to delegate initialization to another constructor.
KaDelegatedPropertyCall¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaDelegatedPropertyCall : KaMultiCall, KaCall
Represents a resolved delegated property, which desugars into up to three operator calls: getValue(), setValue(), and provideDelegate().
KaDelegatedPropertyCallResolutionAttempt¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaDelegatedPropertyCallResolutionAttempt : KaMultiCallResolutionAttempt
Represents an attempt to resolve a delegated property, which desugars into up to three operator calls: getValue(), setValue(), and provideDelegate().
KaErrorCallInfo¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaErrorCallInfo : KaCallInfo
An erroneous call. The candidateCalls and diagnostic can be used to further analyze the error.
KaExplicitReceiverValue¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaExplicitReceiverValue : KaReceiverValue
An explicit receiver value.
KaForLoopCall¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaForLoopCall : KaMultiCall, KaCall
Represents a resolved for loop, which desugars into three operator calls: iterator(), hasNext(), and next().
KaForLoopCallResolutionAttempt¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaForLoopCallResolutionAttempt : KaMultiCallResolutionAttempt
Represents an attempt to resolve a for loop, which desugars into three operator calls: iterator(), hasNext(), and next().
KaFunctionCall¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaFunctionCall<S : KaFunctionSymbol> : KaSimpleCall<S, KaFunctionSignature<S>> , KaCallableMemberCall<S, KaFunctionSignature<S>>
A call to a function within Kotlin code. This includes calls to regular functions, constructors, constructors of superclasses, and annotations.
KaImplicitInvokeCall¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaImplicitInvokeCall : KaFunctionCall<KaNamedFunctionSymbol>
A call to an implicit invoke call.
KaImplicitReceiverValue¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaImplicitReceiverValue : KaReceiverValue
An implicit receiver value.
KaInapplicableCallCandidate¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaInapplicableCallCandidate : KaCallCandidate
A call candidate that is not applicable for a call.
KaInapplicableCallCandidateInfo¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaInapplicableCallCandidateInfo : KaCallCandidateInfo
A call candidate that is not applicable for a call.
KaMultiCall¶
sealed interface KaMultiCall : KaSimpleOrMultiCall
Represents a successful resolution resulting in multiple calls.
KaMultiCallResolutionAttempt¶
sealed interface KaMultiCallResolutionAttempt : KaCallResolutionAttempt
Represents an attempt to resolve a compound (multi) call, such as a for-loop, delegated property access, or compound assignment. The assembled call is always a KaMultiCall.
KaPartiallyAppliedFunctionSymbol¶
typealias KaPartiallyAppliedFunctionSymbol<S> = KaPartiallyAppliedSymbol<S, KaFunctionSignature<S>>
KaPartiallyAppliedSymbol¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaPartiallyAppliedSymbol<out S : KaCallableSymbol, out C : KaCallableSignature<S>> : KaLifetimeOwner
A callable symbol partially applied with receivers and type arguments. Essentially, this is a call that misses some information. For properties, the missing information is the type of access (read, write, or compound access) to this property. For functions, the missing information is the value arguments for the call.
KaPartiallyAppliedVariableSymbol¶
typealias KaPartiallyAppliedVariableSymbol<S> = KaPartiallyAppliedSymbol<S, KaVariableSignature<S>>
KaReceiverValue¶
sealed interface KaReceiverValue : KaLifetimeOwner
A receiver value of a call, which represents either an explicit, implicit, or smart-casted receiver.
KaSimpleCall¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaSimpleCall<S : KaCallableSymbol, C : KaCallableSignature<S>> : KaSimpleOrMultiCall
Represents a successful resolution resulting in a simple call.
KaSimpleCallResolutionAttempt¶
sealed interface KaSimpleCallResolutionAttempt : KaCallResolutionAttempt
Represents an attempt to resolve a simple call (as opposed to a multi-call), which is either a success or an error.
KaSimpleCallResolutionError¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaSimpleCallResolutionError : KaSimpleCallResolutionAttempt
Represents an error that occurred during the resolution of a KtResolvableCall
KaSimpleCallResolutionSuccess¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaSimpleCallResolutionSuccess : KaSimpleCallResolutionAttempt
Represents a successful resolution of a simple KtResolvableCall.
KaSimpleOrMultiCall¶
sealed interface KaSimpleOrMultiCall : KaLifetimeOwner
Represents a resolved call that can be either a simple call or a multi call.
KaSimpleSymbolResolutionAttempt¶
sealed interface KaSimpleSymbolResolutionAttempt : KaSymbolResolutionAttempt
Represents an attempt to resolve a simple (non-compound) KtResolvable, which is either a success or an error.
KaSimpleSymbolResolutionError¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaSimpleSymbolResolutionError : KaSimpleSymbolResolutionAttempt
Represents an error that occurred during the resolution of a KtResolvable
KaSimpleSymbolResolutionSuccess¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaSimpleSymbolResolutionSuccess : KaSimpleSymbolResolutionAttempt
Represents a successful resolution result.
KaSmartCastedReceiverValue¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaSmartCastedReceiverValue : KaReceiverValue
A smart-casted receiver value.
KaSuccessCallInfo¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaSuccessCallInfo : KaCallInfo
A successfully resolved call.
KaSymbolResolutionAttempt¶
sealed interface KaSymbolResolutionAttempt : KaLifetimeOwner
This interface represents an attempt on resolving some KtResolvable through KaResolver.tryResolveSymbols API.
KaVariableAccessCall¶
Access to variables (including properties).
Properties¶
Functions¶
collectCallCandidates¶
context(session: KaSession)
fun KtResolvableCall.collectCallCandidates(): List<KaCallCandidate>
Returns all candidates considered during overload resolution for the call corresponding to the given KtResolvableCall.
resolveSuccessfulCall¶
context(session: KaSession)
fun KtAnnotationEntry.resolveSuccessfulCall(): KaAnnotationCall?
Resolves the given KtAnnotationEntry to an annotation constructor call.
context(session: KaSession)
fun KtArrayAccessExpression.resolveSuccessfulCall(): KaFunctionCall<KaNamedFunctionSymbol>?
Resolves the given KtArrayAccessExpression to a simple function call representing get/set operator invocation.
context(session: KaSession)
fun KtCallElement.resolveSuccessfulCall(): KaFunctionCall<*>?
Resolves the given KtCallElement to a function call.
context(session: KaSession)
fun KtCallableReferenceExpression.resolveSuccessfulCall(): KaCallableReferenceCall<*, *>?
Resolves the given KtCallableReferenceExpression to a callable member call.
context(session: KaSession)
fun KtCollectionLiteralExpression.resolveSuccessfulCall(): KaFunctionCall<KaNamedFunctionSymbol>?
Resolves the given KtCollectionLiteralExpression to a simple function call representing the corresponding array factory invocation.
context(session: KaSession)
fun KtConstructorCalleeExpression.resolveSuccessfulCall(): KaFunctionCall<KaConstructorSymbol>?
Resolves the given KtConstructorCalleeExpression to a constructor call.
context(session: KaSession)
fun KtConstructorDelegationCall.resolveSuccessfulCall(): KaDelegatedConstructorCall?
Resolves the given KtConstructorDelegationCall to a delegated constructor call.
context(session: KaSession)
fun KtConstructorDelegationReferenceExpression.resolveSuccessfulCall(): KaDelegatedConstructorCall?
Resolves the given KtConstructorDelegationReferenceExpression to a delegated constructor call.
context(session: KaSession)
fun KtDestructuringDeclarationEntry.resolveSuccessfulCall(): KaSimpleCall<*, *>?
Resolves the given KtDestructuringDeclarationEntry to a call representing the componentN invocation (for positional destructuring) or the property access (for name-based destructuring).
context(session: KaSession)
fun KtEnumEntrySuperclassReferenceExpression.resolveSuccessfulCall(): KaDelegatedConstructorCall?
Resolves the given KtEnumEntrySuperclassReferenceExpression to a delegated constructor call.
context(session: KaSession)
fun KtForExpression.resolveSuccessfulCall(): KaForLoopCall?
Resolves the given KtForExpression to a KaForLoopCall representing the desugared for loop.
context(session: KaSession)
fun KtNameReferenceExpression.resolveSuccessfulCall(): KaSimpleCall<*, *>?
Resolves the given KtNameReferenceExpression to a call representing the referenced declaration.
context(session: KaSession)
fun KtPropertyDelegate.resolveSuccessfulCall(): KaDelegatedPropertyCall?
Resolves the given KtPropertyDelegate to a KaDelegatedPropertyCall representing the desugared delegated property.
context(session: KaSession)
fun KtQualifiedExpression.resolveSuccessfulCall(): KaSimpleCall<*, *>?
Resolves the given KtQualifiedExpression to a call representing the member or extension access.
context(session: KaSession)
fun KtSuperTypeCallEntry.resolveSuccessfulCall(): KaFunctionCall<KaConstructorSymbol>?
Resolves the given KtSuperTypeCallEntry to a constructor call of the referenced supertype.
context(session: KaSession)
fun KtWhenConditionInRange.resolveSuccessfulCall(): KaFunctionCall<KaNamedFunctionSymbol>?
Resolves the given KtWhenConditionInRange to a simple function call representing the corresponding contains operator invocation used by the in/!in branch condition.
context(session: KaSession)
fun KtResolvableCall.resolveSuccessfulCall(): KaSimpleOrMultiCall?
Resolves the call for the given KtResolvableCall.
resolveSuccessfulSymbol¶
context(session: KaSession)
fun KtAnnotationEntry.resolveSuccessfulSymbol(): KaConstructorSymbol?
Resolves the constructor symbol of the annotation referenced by the given KtAnnotationEntry.
context(session: KaSession)
fun KtArrayAccessExpression.resolveSuccessfulSymbol(): KaNamedFunctionSymbol?
Resolves the operator function symbol targeted by the given KtArrayAccessExpression.
context(session: KaSession)
fun KtCallElement.resolveSuccessfulSymbol(): KaFunctionSymbol?
Resolves the function symbol targeted by the given KtCallElement.
context(session: KaSession)
fun KtCallableReferenceExpression.resolveSuccessfulSymbol(): KaCallableSymbol?
Resolves the callable symbol targeted by the given KtCallableReferenceExpression.
context(session: KaSession)
fun KtClassLiteralExpression.resolveSuccessfulSymbol(): KaClassifierSymbol?
Resolves the classifier symbol referenced by the given KtClassLiteralExpression (Foo::class).
context(session: KaSession)
fun KtCollectionLiteralExpression.resolveSuccessfulSymbol(): KaNamedFunctionSymbol?
Resolves the function symbol targeted by the given KtCollectionLiteralExpression.
context(session: KaSession)
fun KtConstructorCalleeExpression.resolveSuccessfulSymbol(): KaConstructorSymbol?
Resolves the constructor symbol referenced by the given KtConstructorCalleeExpression.
context(session: KaSession)
fun KtConstructorDelegationCall.resolveSuccessfulSymbol(): KaConstructorSymbol?
Resolves the constructor symbol referenced by the given KtConstructorDelegationCall.
context(session: KaSession)
fun KtConstructorDelegationReferenceExpression.resolveSuccessfulSymbol(): KaConstructorSymbol?
Resolves the constructor symbol referenced by the given KtConstructorDelegationReferenceExpression.
context(session: KaSession)
fun KtDelegatedSuperTypeEntry.resolveSuccessfulSymbol(): KaClassifierSymbol?
Resolves the classifier symbol referenced by the given KtDelegatedSuperTypeEntry (class Foo : Bar by baz).
context(session: KaSession)
fun KtDestructuringDeclarationEntry.resolveSuccessfulSymbol(): KaCallableSymbol?
Resolves the callable symbol targeted by the given KtDestructuringDeclarationEntry.
context(session: KaSession)
fun KtEnumEntrySuperclassReferenceExpression.resolveSuccessfulSymbol(): KaNamedClassSymbol?
Resolves the enum class symbol referenced by the given KtEnumEntrySuperclassReferenceExpression.
context(session: KaSession)
fun KtFunctionType.resolveSuccessfulSymbol(): KaClassSymbol?
Resolves the synthetic function class symbol referenced by the given KtFunctionType.
context(session: KaSession)
fun KtInstanceExpressionWithLabel.resolveSuccessfulSymbol(): KaDeclarationSymbol?
Resolves the declaration symbol referenced by the given KtInstanceExpressionWithLabel.
context(session: KaSession)
fun KtLabelReferenceExpression.resolveSuccessfulSymbol(): KaDeclarationSymbol?
Resolves the declaration symbol targeted by the given KtLabelReferenceExpression.
context(session: KaSession)
fun KtNullableType.resolveSuccessfulSymbol(): KaClassifierSymbol?
Resolves the classifier symbol referenced by the given KtNullableType.
context(session: KaSession)
fun KtQualifiedExpression.resolveSuccessfulSymbol(): KaCallableSymbol?
Resolves the callable symbol targeted by the given KtQualifiedExpression.
context(session: KaSession)
fun KtReturnExpression.resolveSuccessfulSymbol(): KaFunctionSymbol?
Resolves the function symbol targeted by the given KtReturnExpression.
context(session: KaSession)
fun KtSuperTypeCallEntry.resolveSuccessfulSymbol(): KaConstructorSymbol?
Resolves the constructor symbol by the given KtSuperTypeCallEntry.
context(session: KaSession)
fun KtSuperTypeEntry.resolveSuccessfulSymbol(): KaClassifierSymbol?
Resolves the classifier symbol referenced by the given KtSuperTypeEntry (the no-parens form class Foo : Bar).
context(session: KaSession)
fun KtTypeReference.resolveSuccessfulSymbol(): KaClassifierSymbol?
Resolves the classifier symbol referenced by the given KtTypeReference.
context(session: KaSession)
fun KtWhenConditionInRange.resolveSuccessfulSymbol(): KaNamedFunctionSymbol?
Resolves the operator function symbol targeted by the given KtWhenConditionInRange.
context(session: KaSession)
fun KtResolvable.resolveSuccessfulSymbol(): KaSymbol?
Resolves a single symbol for the given KtResolvable.
resolveSuccessfulSymbols¶
context(session: KaSession)
fun KtResolvable.resolveSuccessfulSymbols(): Collection<KaSymbol>
Resolves symbols for the given KtResolvable.
tryResolveCall¶
context(session: KaSession)
fun KtForExpression.tryResolveCall(): KaForLoopCallResolutionAttempt?
Attempts to resolve the given KtForExpression to a KaForLoopCallResolutionAttempt containing the individual resolution results for each desugared operator call (iterator, hasNext, next).
context(session: KaSession)
fun KtPropertyDelegate.tryResolveCall(): KaDelegatedPropertyCallResolutionAttempt?
Attempts to resolve the given KtPropertyDelegate to a KaDelegatedPropertyCallResolutionAttempt containing the individual resolution results for each desugared operator call (getValue, setValue, provideDelegate).
context(session: KaSession)
fun KtResolvableCall.tryResolveCall(): KaCallResolutionAttempt?
Attempts to resolve the call for the given KtResolvableCall.
tryResolveSymbols¶
context(session: KaSession)
fun KtResolvable.tryResolveSymbols(): KaSymbolResolutionAttempt?
Attempts to resolve a symbol for the given KtResolvable.