FE1.0 Analysis API: rewrite KtFe10CallResolver

This commit is contained in:
Tianyu Geng
2021-11-29 20:40:02 -08:00
committed by Ilya Kirillov
parent f1bd3597f8
commit 9153db2ecc
37 changed files with 2076 additions and 256 deletions
@@ -5,224 +5,464 @@
package org.jetbrains.kotlin.analysis.api.descriptors.components package org.jetbrains.kotlin.analysis.api.descriptors.components
import org.jetbrains.kotlin.analysis.api.calls.KtCallInfo import org.jetbrains.kotlin.analysis.api.calls.*
import org.jetbrains.kotlin.analysis.api.descriptors.Fe10AnalysisFacade.AnalysisMode
import org.jetbrains.kotlin.analysis.api.descriptors.KtFe10AnalysisSession import org.jetbrains.kotlin.analysis.api.descriptors.KtFe10AnalysisSession
import org.jetbrains.kotlin.analysis.api.descriptors.components.base.Fe10KtAnalysisSessionComponent import org.jetbrains.kotlin.analysis.api.descriptors.components.base.Fe10KtAnalysisSessionComponent
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.KtFe10DescValueParameterSymbol
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.KtFe10ReceiverParameterSymbol
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.base.toKtCallableSymbol
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.base.toKtSymbol
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.base.toKtType
import org.jetbrains.kotlin.analysis.api.diagnostics.KtNonBoundToPsiErrorDiagnostic
import org.jetbrains.kotlin.analysis.api.impl.barebone.parentOfType
import org.jetbrains.kotlin.analysis.api.impl.base.components.AbstractKtCallResolver import org.jetbrains.kotlin.analysis.api.impl.base.components.AbstractKtCallResolver
import org.jetbrains.kotlin.analysis.api.symbols.*
import org.jetbrains.kotlin.analysis.api.tokens.ValidityToken import org.jetbrains.kotlin.analysis.api.tokens.ValidityToken
import org.jetbrains.kotlin.psi.KtElement import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.descriptors.CallableDescriptor
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor
import org.jetbrains.kotlin.diagnostics.DiagnosticWithParameters1
import org.jetbrains.kotlin.diagnostics.DiagnosticWithParameters2
import org.jetbrains.kotlin.diagnostics.Errors
import org.jetbrains.kotlin.diagnostics.Severity
import org.jetbrains.kotlin.lexer.KtTokens
import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.psi.psiUtil.parentsWithSelf
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.calls.components.isVararg
import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall
import org.jetbrains.kotlin.resolve.calls.model.VariableAsFunctionResolvedCall
import org.jetbrains.kotlin.resolve.calls.util.getResolvedCall
import org.jetbrains.kotlin.resolve.scopes.receivers.ExpressionReceiver
import org.jetbrains.kotlin.resolve.scopes.receivers.ExtensionReceiver
import org.jetbrains.kotlin.resolve.scopes.receivers.ImplicitReceiver
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.expressions.ControlStructureTypingUtils
import org.jetbrains.kotlin.util.OperatorNameConventions
internal class KtFe10CallResolver( internal class KtFe10CallResolver(
override val analysisSession: KtFe10AnalysisSession override val analysisSession: KtFe10AnalysisSession
) : AbstractKtCallResolver(), Fe10KtAnalysisSessionComponent { ) : AbstractKtCallResolver(), Fe10KtAnalysisSessionComponent {
private companion object { private companion object {
private const val UNRESOLVED_CALL_MESSAGE = "Unresolved call" private val operatorWithAssignmentVariant = setOf(
OperatorNameConventions.PLUS,
OperatorNameConventions.MINUS,
OperatorNameConventions.TIMES,
OperatorNameConventions.DIV,
OperatorNameConventions.REM,
OperatorNameConventions.MOD,
)
private val callArgErrors = setOf(
Errors.ARGUMENT_PASSED_TWICE,
Errors.MIXING_NAMED_AND_POSITIONED_ARGUMENTS,
Errors.NAMED_PARAMETER_NOT_FOUND,
Errors.NAMED_ARGUMENTS_NOT_ALLOWED,
Errors.VARARG_OUTSIDE_PARENTHESES,
Errors.SPREAD_OF_NULLABLE,
Errors.SPREAD_OF_LAMBDA_OR_CALLABLE_REFERENCE,
Errors.MANY_LAMBDA_EXPRESSION_ARGUMENTS,
Errors.UNEXPECTED_TRAILING_LAMBDA_ON_A_NEW_LINE,
Errors.TOO_MANY_ARGUMENTS,
Errors.REDUNDANT_SPREAD_OPERATOR_IN_NAMED_FORM_IN_FUNCTION,
Errors.REDUNDANT_SPREAD_OPERATOR_IN_NAMED_FORM_IN_ANNOTATION,
Errors.TYPE_MISMATCH,
)
private val resolutionFailureErrors = setOf(
Errors.INVISIBLE_MEMBER,
Errors.NO_VALUE_FOR_PARAMETER,
Errors.MISSING_RECEIVER,
Errors.NO_RECEIVER_ALLOWED,
Errors.ILLEGAL_SELECTOR,
Errors.FUNCTION_EXPECTED,
Errors.FUNCTION_CALL_EXPECTED,
Errors.NO_CONSTRUCTOR,
Errors.OVERLOAD_RESOLUTION_AMBIGUITY,
Errors.NONE_APPLICABLE,
Errors.CANNOT_COMPLETE_RESOLVE,
Errors.UNRESOLVED_REFERENCE_WRONG_RECEIVER,
Errors.CALLABLE_REFERENCE_RESOLUTION_AMBIGUITY,
Errors.TYPE_PARAMETER_AS_REIFIED,
Errors.DEFINITELY_NON_NULLABLE_AS_REIFIED,
Errors.REIFIED_TYPE_FORBIDDEN_SUBSTITUTION,
Errors.REIFIED_TYPE_UNSAFE_SUBSTITUTION,
Errors.CANDIDATE_CHOSEN_USING_OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION,
Errors.RESOLUTION_TO_CLASSIFIER,
Errors.RESERVED_SYNTAX_IN_CALLABLE_REFERENCE_LHS,
Errors.PARENTHESIZED_COMPANION_LHS_DEPRECATION,
Errors.RESOLUTION_TO_PRIVATE_CONSTRUCTOR_OF_SEALED_CLASS,
Errors.UNRESOLVED_REFERENCE,
)
val diagnosticWithResolvedCallsAtPosition1 = setOf(
Errors.OVERLOAD_RESOLUTION_AMBIGUITY,
Errors.NONE_APPLICABLE,
Errors.CANNOT_COMPLETE_RESOLVE,
Errors.UNRESOLVED_REFERENCE_WRONG_RECEIVER,
Errors.ASSIGN_OPERATOR_AMBIGUITY,
Errors.ITERATOR_AMBIGUITY,
)
val diagnosticWithResolvedCallsAtPosition2 = setOf(
Errors.COMPONENT_FUNCTION_AMBIGUITY,
Errors.DELEGATE_SPECIAL_FUNCTION_AMBIGUITY,
Errors.DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE,
Errors.DELEGATE_PD_METHOD_NONE_APPLICABLE,
)
} }
override val token: ValidityToken override val token: ValidityToken
get() = analysisSession.token get() = analysisSession.token
override fun resolveCall(psi: KtElement): KtCallInfo? { override fun resolveCall(psi: KtElement): KtCallInfo? = with(analysisContext.analyze(psi, AnalysisMode.PARTIAL_WITH_DIAGNOSTICS)) {
return null val parentBinaryExpression = psi.parentOfType<KtBinaryExpression>()
val lhs = KtPsiUtil.deparenthesize(parentBinaryExpression?.left)
val unwrappedPsi = KtPsiUtil.deparenthesize(psi as? KtExpression) ?: psi
if (parentBinaryExpression != null &&
parentBinaryExpression.operationToken == KtTokens.EQ &&
(lhs == unwrappedPsi || (lhs as? KtQualifiedExpression)?.selectorExpression == unwrappedPsi) &&
unwrappedPsi !is KtArrayAccessExpression
) {
// Specially handle property assignment because FE1.0 resolves LHS of assignment to just the property, which would then be
// treated as a property read.
return resolveCall(parentBinaryExpression)
}
when (unwrappedPsi) {
is KtBinaryExpression -> {
handleAsCompoundAssignment(this, unwrappedPsi)?.let { return@with it }
handleAsFunctionCall(this, unwrappedPsi)
}
is KtUnaryExpression -> {
handleAsIncOrDecOperator(this, unwrappedPsi)?.let { return@with it }
handleAsFunctionCall(this, unwrappedPsi)
}
else -> handleAsFunctionCall(this, unwrappedPsi) ?: handleAsPropertyRead(this, unwrappedPsi)
} ?: handleResolveErrors(this, psi)
} }
// override fun resolveAccessorCall(call: KtSimpleNameExpression): KtCall? { private fun handleAsCompoundAssignment(context: BindingContext, binaryExpression: KtBinaryExpression): KtCallInfo? {
// val bindingContext = analysisContext.analyze(call, AnalysisMode.PARTIAL_WITH_DIAGNOSTICS) val left = binaryExpression.left ?: return null
// val resolvedCall = call.getResolvedCall(bindingContext) ?: return null val right = binaryExpression.right
// val targetDescriptor = resolvedCall.candidateDescriptor val resolvedCalls = mutableListOf<ResolvedCall<*>>()
// return when (binaryExpression.operationToken) {
// if (targetDescriptor is PropertyDescriptor) { KtTokens.EQ -> {
// @Suppress("DEPRECATION") val resolvedCall = left.getResolvedCall(context) ?: return null
// val access = call.readWriteAccessWithFullExpressionWithPossibleResolve( resolvedCalls += resolvedCall
// readWriteAccessWithFullExpressionByResolve = { null } val partiallyAppliedSymbol =
// ).first resolvedCall.toPartiallyAppliedVariableSymbol(context) ?: return null
// KtSimpleVariableAccessCall(partiallyAppliedSymbol, KtSimpleVariableAccess.Write(right))
// val setterValue = findAssignment(call)?.right }
// val accessorSymbol = when (targetDescriptor) { in KtTokens.AUGMENTED_ASSIGNMENTS -> {
// is SyntheticJavaPropertyDescriptor -> { if (right == null) return null
// when { val operatorCall = binaryExpression.getResolvedCall(context) ?: return null
// access.isWrite -> targetDescriptor.setMethod?.let { KtFe10DescFunctionSymbol.build(it, analysisContext) } resolvedCalls += operatorCall
// access.isRead -> KtFe10DescFunctionSymbol.build(targetDescriptor.getMethod, analysisContext) // This method only handles compound assignment. Other cases like `plusAssign`, `rangeTo`, `contains` are handled by plain
// else -> null // `handleAsFunctionCall`
// } if (operatorCall.resultingDescriptor.name !in operatorWithAssignmentVariant) return null
// } val operatorPartiallyAppliedSymbol =
// else -> { operatorCall.toPartiallyAppliedFunctionSymbol<KtFunctionSymbol>(context) ?: return null
// when {
// access.isWrite -> targetDescriptor.setter?.let { KtFe10DescPropertySetterSymbol(it, analysisContext) } val compoundAccess = KtCompoundAccess.CompoundAssign(
// access.isRead -> targetDescriptor.getter?.let { KtFe10DescPropertyGetterSymbol(it, analysisContext) } operatorPartiallyAppliedSymbol,
// else -> null binaryExpression.getCompoundAssignKind(),
// } right
// } )
// }
// if (left is KtArrayAccessExpression) {
// if (accessorSymbol != null) { createCompoundArrayAccessCall(context, left, compoundAccess, resolvedCalls)
// val target = when { } else {
// !access.isWrite || setterValue != null -> KtSuccessCallTarget(accessorSymbol, token) val resolvedCall = left.getResolvedCall(context) ?: return null
// else -> { resolvedCalls += resolvedCall
// val diagnostic = KtNonBoundToPsiErrorDiagnostic(factoryName = null, "Setter value is missing", token) val variableAppliedSymbol = resolvedCall.toPartiallyAppliedVariableSymbol(context) ?: return null
// KtErrorCallTarget(listOf(accessorSymbol), diagnostic, token) KtCompoundVariableAccessCall(variableAppliedSymbol, compoundAccess)
// } }
// } }
// else -> null
// val argumentMapping = LinkedHashMap<KtExpression, KtValueParameterSymbol>() }?.let { createCallInfo(context, binaryExpression, it, resolvedCalls) }
// if (access.isWrite && setterValue != null) { }
// val setterParameterSymbol = accessorSymbol.valueParameters.single()
// argumentMapping[setterValue] = setterParameterSymbol private fun handleAsIncOrDecOperator(context: BindingContext, unaryExpression: KtUnaryExpression): KtCallInfo? {
// } if (unaryExpression.operationToken !in KtTokens.INCREMENT_AND_DECREMENT) return null
// val operatorCall = unaryExpression.getResolvedCall(context) ?: return null
// return KtFunctionCall(argumentMapping, target, getSubstitutor(resolvedCall), token) val resolvedCalls = mutableListOf(operatorCall)
// } val operatorPartiallyAppliedSymbol = operatorCall.toPartiallyAppliedFunctionSymbol<KtFunctionSymbol>(context) ?: return null
// } val baseExpression = unaryExpression.baseExpression
// val kind = unaryExpression.getInOrDecOperationKind()
// return null val precedence = when (unaryExpression) {
// } is KtPostfixExpression -> KtCompoundAccess.IncOrDecOperation.Precedence.POSTFIX
// is KtPrefixExpression -> KtCompoundAccess.IncOrDecOperation.Precedence.PREFIX
// override fun resolveCall(call: KtCallElement): KtCall? = withValidityAssertion { else -> error("unexpected KtUnaryExpression $unaryExpression")
// return resolveCall(call, isUsualCall = true) }
// } val compoundAccess = KtCompoundAccess.IncOrDecOperation(operatorPartiallyAppliedSymbol, kind, precedence)
// return if (baseExpression is KtArrayAccessExpression) {
// override fun resolveCall(call: KtBinaryExpression): KtCall? = withValidityAssertion { createCompoundArrayAccessCall(context, baseExpression, compoundAccess, resolvedCalls)
// return resolveCall(call, isUsualCall = false) } else {
// } val variableAppliedSymbol = baseExpression.getResolvedCall(context)?.toPartiallyAppliedVariableSymbol(context) ?: return null
// KtCompoundVariableAccessCall(variableAppliedSymbol, compoundAccess)
// override fun resolveCall(call: KtUnaryExpression): KtCall? = withValidityAssertion { }?.let { createCallInfo(context, unaryExpression, it, resolvedCalls) }
// return resolveCall(call, isUsualCall = false) }
// }
// private fun createCompoundArrayAccessCall(
// override fun resolveCall(call: KtArrayAccessExpression): KtCall? = withValidityAssertion { context: BindingContext,
// return resolveCall(call, isUsualCall = false) arrayAccessExpression: KtArrayAccessExpression,
// } compoundAccess: KtCompoundAccess,
// resolvedCalls: MutableList<ResolvedCall<*>>
// private fun getSubstitutor(vararg resolvedCall: ResolvedCall<*>): KtSubstitutor { ): KtCompoundArrayAccessCall? {
// val typeArguments = if (resolvedCall.size == 1) { val resolvedGetCall = context[BindingContext.INDEXED_LVALUE_GET, arrayAccessExpression] ?: return null
// resolvedCall[0].typeArguments resolvedCalls += resolvedGetCall
// } else { val getPartiallyAppliedSymbol = resolvedGetCall.toPartiallyAppliedFunctionSymbol<KtFunctionSymbol>(context) ?: return null
// buildMap { val resolvedSetCall = context[BindingContext.INDEXED_LVALUE_SET, arrayAccessExpression] ?: return null
// resolvedCall.forEach { putAll(it.typeArguments) } resolvedCalls += resolvedSetCall
// } val setPartiallyAppliedSymbol = resolvedSetCall.toPartiallyAppliedFunctionSymbol<KtFunctionSymbol>(context) ?: return null
// } return KtCompoundArrayAccessCall(
// compoundAccess,
// if (typeArguments.isEmpty()) { arrayAccessExpression.indexExpressions,
// return KtSubstitutor.Empty(analysisContext.token) getPartiallyAppliedSymbol,
// } setPartiallyAppliedSymbol
// )
// val typeSubstitution = object : TypeConstructorSubstitution() { }
// override fun get(key: TypeConstructor): TypeProjection? {
// val type = typeArguments[key.declarationDescriptor] ?: return null private fun handleAsFunctionCall(context: BindingContext, element: KtElement): KtCallInfo? {
// return TypeProjectionImpl(Variance.INVARIANT, type) val resolvedCall = element.getResolvedCall(context)
// } if (element is KtUnaryExpression && resolvedCall?.candidateDescriptor?.name == ControlStructureTypingUtils.ResolveConstruct.EXCL_EXCL.specialFunctionName) {
// val baseExpression = element.baseExpression ?: return null
// override fun isEmpty() = typeArguments.isEmpty() return KtSuccessCallInfo(KtCheckNotNullCall(token, baseExpression))
// } }
// return if (resolvedCall is VariableAsFunctionResolvedCall) {
// val typeSubstitutor = TypeSubstitutor.create(typeSubstitution) if (element is KtCallExpression) {
// // TODO: consider demoting extension receiver to the first argument to align with FIR behavior. See test case
// return object : KtMapBackedSubstitutor { // analysis/analysis-api/testData/components/callResolver/resolveCall/functionTypeVariableCall_dispatchReceiver.kt:5 where
// override val token: ValidityToken // FIR and FE1.0 behaves differently because FIR unifies extension receiver of functional type as the first argument
// get() = analysisContext.token resolvedCall.functionCall.toFunctionKtCall(context)
// } else {
// val map: Map<KtTypeParameterSymbol, KtType> by cached { resolvedCall.variableCall.toPropertyRead(context)
// val symbolicMap = LinkedHashMap<KtTypeParameterSymbol, KtType>(typeArguments.size) }?.let { createCallInfo(context, element, it, listOf(resolvedCall)) }
// for ((typeParameter, type) in typeArguments) { } else {
// val typeParameterSymbol = KtFe10DescTypeParameterSymbol(typeParameter, analysisContext) resolvedCall?.toFunctionKtCall(context)?.let { createCallInfo(context, element, it, listOf(resolvedCall)) }
// symbolicMap[typeParameterSymbol] = type.toKtType(analysisContext) }
// } }
// return@cached symbolicMap
// } private fun handleAsPropertyRead(contexe: BindingContext, element: KtElement): KtCallInfo? {
// val call = element.getResolvedCall(contexe) ?: return null
// override fun getAsMap(): Map<KtTypeParameterSymbol, KtType> { return call.toPropertyRead(contexe)?.let { createCallInfo(contexe, element, it, listOf(call)) }
// return map }
// }
// private fun ResolvedCall<*>.toPropertyRead(context: BindingContext): KtVariableAccessCall? {
// override fun substituteOrNull(type: KtType): KtType { val partiallyAppliedSymbol = toPartiallyAppliedVariableSymbol(context) ?: return null
// require(type is KtFe10Type) return KtSimpleVariableAccessCall(partiallyAppliedSymbol, KtSimpleVariableAccess.Read)
// return typeSubstitutor.substitute(type.type).toKtType(analysisContext) }
// }
// } private fun ResolvedCall<*>.toFunctionKtCall(context: BindingContext): KtFunctionCall<*>? {
// } val partiallyAppliedSymbol = toPartiallyAppliedFunctionSymbol<KtFunctionLikeSymbol>(context) ?: return null
// val argumentMapping = createArgumentMapping(partiallyAppliedSymbol.signature)
// /** if (partiallyAppliedSymbol.signature.symbol is KtConstructorSymbol) {
// * Analyze the given call element (a function call, unary/binary operator call, or convention call). @Suppress("UNCHECKED_CAST")
// * val partiallyAppliedConstructorSymbol = partiallyAppliedSymbol as KtPartiallyAppliedFunctionSymbol<KtConstructorSymbol>
// * @param call the call element to analyze. when (val callElement = call.callElement) {
// * @param isUsualCall `true` if the call is a usual function call (`foo()` or `foo {}`). is KtAnnotationEntry -> return KtAnnotationCall(partiallyAppliedSymbol, argumentMapping)
// */ is KtConstructorDelegationCall -> return KtDelegatedConstructorCall(
// private fun resolveCall(call: KtElement, isUsualCall: Boolean): KtCall? { partiallyAppliedConstructorSymbol,
// val bindingContext = analysisContext.analyze(call, AnalysisMode.PARTIAL_WITH_DIAGNOSTICS) if (callElement.isCallToThis) KtDelegatedConstructorCall.Kind.THIS_CALL else KtDelegatedConstructorCall.Kind.SUPER_CALL,
// val resolvedCall = call.getResolvedCall(bindingContext) ?: return getUnresolvedCall(call) argumentMapping
// )
// val argumentMapping = createArgumentMapping(resolvedCall) }
// }
// fun getTarget(targetSymbol: KtFunctionLikeSymbol): KtCallTarget { @Suppress("UNCHECKED_CAST")
// if (resolvedCall.status == ResolutionStatus.SUCCESS) { return KtSimpleFunctionCall(partiallyAppliedSymbol, argumentMapping, call.callType == Call.CallType.INVOKE)
// return KtSuccessCallTarget(targetSymbol, token) }
// }
// private fun ResolvedCall<*>.toPartiallyAppliedVariableSymbol(context: BindingContext): KtPartiallyAppliedVariableSymbol<KtVariableLikeSymbol>? {
// val diagnostic = KtNonBoundToPsiErrorDiagnostic(factoryName = null, UNRESOLVED_CALL_MESSAGE, token) val partiallyAppliedSymbol = toPartiallyAppliedSymbol(context) ?: return null
// return KtErrorCallTarget(listOf(targetSymbol), diagnostic, token) if (partiallyAppliedSymbol.signature !is KtVariableLikeSignature<*>) return null
// } @Suppress("UNCHECKED_CAST")
// return partiallyAppliedSymbol as KtPartiallyAppliedVariableSymbol<KtVariableLikeSymbol>
// val targetDescriptor = resolvedCall.candidateDescriptor }
//
// val callableSymbol = targetDescriptor.toKtCallableSymbol(analysisContext) as? KtFunctionLikeSymbol ?: return null
// private inline fun <reified S : KtFunctionLikeSymbol> ResolvedCall<*>.toPartiallyAppliedFunctionSymbol(context: BindingContext): KtPartiallyAppliedFunctionSymbol<S>? {
// if (resolvedCall is VariableAsFunctionResolvedCall) { val partiallyAppliedSymbol = toPartiallyAppliedSymbol(context) ?: return null
// val variableDescriptor = resolvedCall.variableCall.candidateDescriptor if (partiallyAppliedSymbol.symbol !is S) return null
// val variableSymbol = variableDescriptor.toKtCallableSymbol(analysisContext) as? KtVariableLikeSymbol ?: return null @Suppress("UNCHECKED_CAST")
// return partiallyAppliedSymbol as KtPartiallyAppliedFunctionSymbol<S>
// val substitutor = getSubstitutor(resolvedCall.functionCall, resolvedCall.variableCall) }
// return if (resolvedCall.functionCall.candidateDescriptor.callableIdIfNotLocal in kotlinFunctionInvokeCallableIds) {
// KtFunctionalTypeVariableCall(variableSymbol, argumentMapping, getTarget(callableSymbol), substitutor, token) private fun ResolvedCall<*>.toPartiallyAppliedSymbol(context: BindingContext): KtPartiallyAppliedSymbol<*, *>? {
// } else { val targetDescriptor = candidateDescriptor
// KtVariableWithInvokeFunctionCall(variableSymbol, argumentMapping, getTarget(callableSymbol), substitutor, token) val symbol = targetDescriptor.toKtCallableSymbol(analysisContext) ?: return null
// } val signature = createSignature(symbol, resultingDescriptor) ?: return null
// } if (targetDescriptor.isSynthesizedPropertyFromJavaAccessors()) {
// // FE1.0 represents synthesized properties as an extension property of the Java class. Hence we use the extension receiver as
// if (call is KtConstructorDelegationCall) { // the dispatch receiver and always pass null for extension receiver (because in Java there is no way to specify an extension
// return KtDelegatedConstructorCall(argumentMapping, getTarget(callableSymbol), call.kind, token) // receiver)
// } return KtPartiallyAppliedSymbol(
// signature,
// if (isUsualCall) { extensionReceiver?.toKtReceiverValue(context, this),
// if (targetDescriptor.isAnnotationConstructor() && (call is KtAnnotationEntry || call.parent is KtAnnotationEntry)) { null
// return KtAnnotationCall(argumentMapping, getTarget(callableSymbol), token) )
// } } else {
// } return KtPartiallyAppliedSymbol(
// signature,
// return KtFunctionCall(argumentMapping, getTarget(callableSymbol), getSubstitutor(resolvedCall), token) dispatchReceiver?.toKtReceiverValue(context, this, smartCastDispatchReceiverType),
// } extensionReceiver?.toKtReceiverValue(context, this),
// )
// private fun getUnresolvedCall(call: KtElement): KtCall? { }
// return when (call) { }
// is KtSuperTypeCallEntry -> {
// val diagnostic = KtNonBoundToPsiErrorDiagnostic(factoryName = null, UNRESOLVED_CALL_MESSAGE, token) private fun ReceiverValue.toKtReceiverValue(
// val target = KtErrorCallTarget(emptyList(), diagnostic, token) context: BindingContext,
// KtDelegatedConstructorCall(LinkedHashMap(), target, KtDelegatedConstructorCallKind.SUPER_CALL, token) resolvedCall: ResolvedCall<*>,
// } smartCastType: KotlinType? = null
// is KtConstructorDelegationCall -> { ): KtReceiverValue? {
// val diagnostic = KtNonBoundToPsiErrorDiagnostic(factoryName = null, UNRESOLVED_CALL_MESSAGE, token) val result = when (this) {
// val target = KtErrorCallTarget(emptyList(), diagnostic, token) is ExpressionReceiver -> expression.toExplicitReceiverValue()
// return KtDelegatedConstructorCall(LinkedHashMap(), target, call.kind, token) is ExtensionReceiver -> {
// } val extensionReceiverParameter = this.declarationDescriptor.extensionReceiverParameter ?: return null
// else -> null KtImplicitReceiverValue(KtFe10ReceiverParameterSymbol(extensionReceiverParameter, analysisContext))
// } }
// } is ImplicitReceiver -> {
// val symbol = this.declarationDescriptor.toKtSymbol(analysisContext) ?: return null
// private val KtConstructorDelegationCall.kind: KtDelegatedConstructorCallKind KtImplicitReceiverValue(symbol)
// get() = when { }
// isCallToThis -> KtDelegatedConstructorCallKind.THIS_CALL else -> null
// else -> KtDelegatedConstructorCallKind.SUPER_CALL }
// } var smartCastTypeToUse = smartCastType
// if (smartCastTypeToUse == null) {
// private fun createArgumentMapping(resolvedCall: ResolvedCall<*>): LinkedHashMap<KtExpression, KtValueParameterSymbol> { when (result) {
// val result = LinkedHashMap<KtExpression, KtValueParameterSymbol>() is KtExplicitReceiverValue -> {
// for ((parameter, arguments) in resolvedCall.valueArguments) { smartCastTypeToUse = context[BindingContext.SMARTCAST, result.expression]?.type(resolvedCall.call)
// val parameterSymbol = KtFe10DescValueParameterSymbol(parameter, analysisContext) }
// is KtImplicitReceiverValue -> {
// for (argument in arguments.arguments) { smartCastTypeToUse =
// val expression = argument.getArgumentExpression() ?: continue context[BindingContext.IMPLICIT_RECEIVER_SMARTCAST, resolvedCall.call.calleeExpression]?.receiverTypes?.get(this)
// result[expression] = parameterSymbol }
// } else -> {}
// } }
// return result }
// } return if (smartCastTypeToUse != null && result != null) {
KtSmartCastedReceiverValue(result, smartCastTypeToUse.toKtType(analysisContext))
} else {
result
}
}
private fun createSignature(symbol: KtSymbol, resultingDescriptor: CallableDescriptor): KtSignature<*>? {
val returnType = if (resultingDescriptor is ValueParameterDescriptor && resultingDescriptor.isVararg) {
val arrayType = resultingDescriptor.returnType ?: return null
val primitiveArrayElementType = KotlinBuiltIns.getPrimitiveArrayElementType(arrayType)
if (primitiveArrayElementType == null) {
arrayType.arguments.singleOrNull()?.type
} else {
analysisContext.builtIns.getPrimitiveKotlinType(primitiveArrayElementType)
}
} else {
resultingDescriptor.returnType
}
val ktReturnType = returnType?.toKtType(analysisContext) ?: return null
val receiverType = if (resultingDescriptor.isSynthesizedPropertyFromJavaAccessors()) {
// FE1.0 represents synthesized properties as an extension property of the Java class. Hence the extension receiver type should
// always be null
null
} else {
resultingDescriptor.extensionReceiverParameter?.returnType?.toKtType(analysisContext)
}
return when (symbol) {
is KtVariableLikeSymbol -> KtVariableLikeSignature(symbol, ktReturnType, receiverType)
is KtFunctionLikeSymbol -> KtFunctionLikeSignature(
symbol,
ktReturnType,
receiverType,
@Suppress("UNCHECKED_CAST")
symbol.valueParameters.zip(resultingDescriptor.valueParameters).map { (symbol, resultingDescriptor) ->
createSignature(symbol, resultingDescriptor) as KtVariableLikeSignature<KtValueParameterSymbol>
})
else -> error("unexpected callable symbol $this")
}
}
private fun CallableDescriptor?.isSynthesizedPropertyFromJavaAccessors() =
this is PropertyDescriptor && kind == CallableMemberDescriptor.Kind.SYNTHESIZED
private fun ResolvedCall<*>.createArgumentMapping(signature: KtFunctionLikeSignature<*>): LinkedHashMap<KtExpression, KtVariableLikeSignature<KtValueParameterSymbol>> {
val parameterSignatureByName = signature.valueParameters.associateBy { it.symbol.name }
val result = LinkedHashMap<KtExpression, KtVariableLikeSignature<KtValueParameterSymbol>>()
for ((parameter, arguments) in valueArguments) {
val parameterSymbol = KtFe10DescValueParameterSymbol(parameter, analysisContext)
for (argument in arguments.arguments) {
val expression = argument.getArgumentExpression() ?: continue
result[expression] = parameterSignatureByName[parameterSymbol.name] ?: continue
}
}
return result
}
private fun createCallInfo(context: BindingContext, psi: KtElement, ktCall: KtCall, resolvedCalls: List<ResolvedCall<*>>): KtCallInfo {
val failedResolveCall = resolvedCalls.firstOrNull { !it.status.isSuccess } ?: return KtSuccessCallInfo(ktCall)
val diagnostic = getDiagnosticToReport(context, psi, ktCall)?.let { KtFe10Diagnostic(it, token) }
?: KtNonBoundToPsiErrorDiagnostic(
factoryName = null,
"${failedResolveCall.status} with ${failedResolveCall.resultingDescriptor.name}",
token
)
return KtErrorCallInfo(listOf(ktCall), diagnostic, token)
}
private fun handleResolveErrors(context: BindingContext, psi: KtElement): KtErrorCallInfo? {
val diagnostic = getDiagnosticToReport(context, psi, null) ?: return null
val ktDiagnostic = diagnostic.let { KtFe10Diagnostic(it, token) }
val calls = when (diagnostic.factory) {
in diagnosticWithResolvedCallsAtPosition1 -> {
require(diagnostic is DiagnosticWithParameters1<*, *>)
@Suppress("UNCHECKED_CAST")
diagnostic.a as Collection<ResolvedCall<*>>
}
in diagnosticWithResolvedCallsAtPosition2 -> {
require(diagnostic is DiagnosticWithParameters2<*, *, *>)
@Suppress("UNCHECKED_CAST")
diagnostic.b as Collection<ResolvedCall<*>>
}
else -> {
emptyList()
}
}
return KtErrorCallInfo(calls.mapNotNull { it.toFunctionKtCall(context) ?: it.toPropertyRead(context) }, ktDiagnostic, token)
}
private fun getDiagnosticToReport(
context: BindingContext, psi: KtElement, ktCall: KtCall?
) = context.diagnostics.firstOrNull { diagnostic ->
if (diagnostic.severity != Severity.ERROR) return@firstOrNull false
val isResolutionError = diagnostic.factory in resolutionFailureErrors
val isCallArgError = diagnostic.factory in callArgErrors
val reportedPsi = diagnostic.psiElement
val reportedPsiParent = reportedPsi.parent
when {
// Errors reported on the querying element or the `selectorExpression`/`calleeExpression` of the querying element
isResolutionError &&
(reportedPsi == psi ||
psi is KtQualifiedExpression && reportedPsi == psi.selectorExpression ||
psi is KtCallElement && reportedPsi.parentsWithSelf.any { it == psi.calleeExpression }) -> true
// Errors reported on the value argument list or the right most parentheses (not enough argument, for example)
isResolutionError &&
reportedPsi is KtValueArgumentList || reportedPsiParent is KtValueArgumentList && reportedPsi == reportedPsiParent.rightParenthesis -> true
// errors on call args for normal function calls
isCallArgError &&
reportedPsiParent is KtValueArgument && psi is KtCallElement && reportedPsiParent in psi.valueArguments -> true
// errors on index args for array access convention
isCallArgError &&
reportedPsiParent is KtContainerNode && reportedPsiParent.parent is KtArrayAccessExpression -> true
// errors on lambda args
isCallArgError &&
reportedPsi is KtLambdaExpression || reportedPsi is KtLambdaArgument -> true
// errors on value to set using array access convention
isCallArgError &&
ktCall is KtSimpleFunctionCall && (reportedPsiParent as? KtBinaryExpression)?.right == reportedPsi -> true
else -> false
}
}
} }
@@ -9,8 +9,8 @@ import com.intellij.openapi.util.TextRange
import com.intellij.psi.PsiElement import com.intellij.psi.PsiElement
import org.jetbrains.kotlin.analysis.api.components.KtDiagnosticCheckerFilter import org.jetbrains.kotlin.analysis.api.components.KtDiagnosticCheckerFilter
import org.jetbrains.kotlin.analysis.api.components.KtDiagnosticProvider import org.jetbrains.kotlin.analysis.api.components.KtDiagnosticProvider
import org.jetbrains.kotlin.analysis.api.descriptors.KtFe10AnalysisSession
import org.jetbrains.kotlin.analysis.api.descriptors.Fe10AnalysisFacade.AnalysisMode import org.jetbrains.kotlin.analysis.api.descriptors.Fe10AnalysisFacade.AnalysisMode
import org.jetbrains.kotlin.analysis.api.descriptors.KtFe10AnalysisSession
import org.jetbrains.kotlin.analysis.api.descriptors.components.base.Fe10KtAnalysisSessionComponent import org.jetbrains.kotlin.analysis.api.descriptors.components.base.Fe10KtAnalysisSessionComponent
import org.jetbrains.kotlin.analysis.api.diagnostics.KtDiagnosticWithPsi import org.jetbrains.kotlin.analysis.api.diagnostics.KtDiagnosticWithPsi
import org.jetbrains.kotlin.analysis.api.tokens.ValidityToken import org.jetbrains.kotlin.analysis.api.tokens.ValidityToken
@@ -19,6 +19,7 @@ import org.jetbrains.kotlin.diagnostics.Diagnostic
import org.jetbrains.kotlin.diagnostics.DiagnosticFactory import org.jetbrains.kotlin.diagnostics.DiagnosticFactory
import org.jetbrains.kotlin.diagnostics.Severity import org.jetbrains.kotlin.diagnostics.Severity
import org.jetbrains.kotlin.diagnostics.UnboundDiagnostic import org.jetbrains.kotlin.diagnostics.UnboundDiagnostic
import org.jetbrains.kotlin.diagnostics.rendering.DefaultErrorMessages
import org.jetbrains.kotlin.psi.KtElement import org.jetbrains.kotlin.psi.KtElement
import org.jetbrains.kotlin.psi.KtFile import org.jetbrains.kotlin.psi.KtFile
import kotlin.reflect.KClass import kotlin.reflect.KClass
@@ -51,7 +52,7 @@ internal class KtFe10DiagnosticProvider(
} }
} }
private class KtFe10Diagnostic(private val diagnostic: Diagnostic, override val token: ValidityToken) : KtDiagnosticWithPsi<PsiElement> { internal class KtFe10Diagnostic(private val diagnostic: Diagnostic, override val token: ValidityToken) : KtDiagnosticWithPsi<PsiElement> {
override val severity: Severity override val severity: Severity
get() = diagnostic.severity get() = diagnostic.severity
@@ -62,7 +63,9 @@ private class KtFe10Diagnostic(private val diagnostic: Diagnostic, override val
get() { get() {
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
val factory = diagnostic.factory as DiagnosticFactory<UnboundDiagnostic>? val factory = diagnostic.factory as DiagnosticFactory<UnboundDiagnostic>?
return factory?.defaultRenderer?.render(diagnostic) ?: "" return factory?.defaultRenderer?.render(diagnostic)
?: DefaultErrorMessages.getRendererForDiagnostic(diagnostic)?.render(diagnostic)
?: ""
} }
override val psi: PsiElement override val psi: PsiElement
@@ -0,0 +1,31 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased
import org.jetbrains.kotlin.analysis.api.descriptors.Fe10AnalysisContext
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.base.KtFe10DescSymbol
import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.base.toKtType
import org.jetbrains.kotlin.analysis.api.symbols.KtReceiverParameterSymbol
import org.jetbrains.kotlin.analysis.api.symbols.KtSymbol
import org.jetbrains.kotlin.analysis.api.symbols.pointers.KtSymbolPointer
import org.jetbrains.kotlin.analysis.api.types.KtType
import org.jetbrains.kotlin.analysis.api.withValidityAssertion
import org.jetbrains.kotlin.descriptors.ReceiverParameterDescriptor
class KtFe10ReceiverParameterSymbol(
private val _descriptor: ReceiverParameterDescriptor,
override val analysisContext: Fe10AnalysisContext
) : KtReceiverParameterSymbol(), KtFe10DescSymbol<ReceiverParameterDescriptor> {
override val type: KtType
get() = withValidityAssertion { _descriptor.returnType?.toKtType(analysisContext) ?: error("expect return type for $_descriptor") }
override val descriptor: ReceiverParameterDescriptor
get() = withValidityAssertion { _descriptor }
override fun createPointer(): KtSymbolPointer<KtSymbol> {
TODO("Not yet implemented")
}
}
@@ -202,8 +202,11 @@ private fun KotlinType.hasReferenceOtherThan(allowedTypeParameterDescriptors: Se
*/ */
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
private fun <T : CallableDescriptor> T.unwrapUseSiteSubstitutionOverride(): T { private fun <T : CallableDescriptor> T.unwrapUseSiteSubstitutionOverride(): T {
if (original == this) return this var current: CallableDescriptor = this
return original.unwrapUseSiteSubstitutionOverride() as T while (original != current) {
current = current.original
}
return current as T
} }
internal fun KotlinType.toKtType(analysisContext: Fe10AnalysisContext): KtType { internal fun KotlinType.toKtType(analysisContext: Fe10AnalysisContext): KtType {
@@ -0,0 +1,728 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.descriptors.test.components.callResolver;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.jetbrains.kotlin.test.TestMetadata;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import java.io.File;
import java.util.regex.Pattern;
/** This class is generated by {@link GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@TestMetadata("analysis/analysis-api/testData/components/callResolver/resolveCall")
@TestDataPath("$PROJECT_ROOT")
public class KtFe10ResolveCallTestGenerated extends AbstractKtFe10ResolveCallTest {
@Test
public void testAllFilesPresentInResolveCall() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/callResolver/resolveCall"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("annotationEntry.kt")
public void testAnnotationEntry() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/annotationEntry.kt");
}
@Test
@TestMetadata("annotationInAnnotation_arrayOf.kt")
public void testAnnotationInAnnotation_arrayOf() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_arrayOf.kt");
}
@Test
@TestMetadata("annotationInAnnotation_collectionLiteral.kt")
public void testAnnotationInAnnotation_collectionLiteral() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_collectionLiteral.kt");
}
@Test
@TestMetadata("annotationInAnnotation_multipleAnnotations_arrayOf.kt")
public void testAnnotationInAnnotation_multipleAnnotations_arrayOf() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_multipleAnnotations_arrayOf.kt");
}
@Test
@TestMetadata("annotationInAnnotation_multipleAnnotations_collectionLiteral.kt")
public void testAnnotationInAnnotation_multipleAnnotations_collectionLiteral() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_multipleAnnotations_collectionLiteral.kt");
}
@Test
@TestMetadata("annotationInAnnotation_noarg.kt")
public void testAnnotationInAnnotation_noarg() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_noarg.kt");
}
@Test
@TestMetadata("annotationInAnnotation_vararg.kt")
public void testAnnotationInAnnotation_vararg() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_vararg.kt");
}
@Test
@TestMetadata("annotationOnDelegate.kt")
public void testAnnotationOnDelegate() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnDelegate.kt");
}
@Test
@TestMetadata("annotationOnExpression_asT.kt")
public void testAnnotationOnExpression_asT() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnExpression_asT.kt");
}
@Test
@TestMetadata("annotationOnExpression_destructuring.kt")
public void testAnnotationOnExpression_destructuring() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnExpression_destructuring.kt");
}
@Test
@TestMetadata("annotationOnExpression_if.kt")
public void testAnnotationOnExpression_if() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnExpression_if.kt");
}
@Test
@TestMetadata("annotationOnExpression_whenBranch.kt")
public void testAnnotationOnExpression_whenBranch() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnExpression_whenBranch.kt");
}
@Test
@TestMetadata("annotationOnFile.kt")
public void testAnnotationOnFile() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnFile.kt");
}
@Test
@TestMetadata("annotationOnParameter_param.kt")
public void testAnnotationOnParameter_param() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnParameter_param.kt");
}
@Test
@TestMetadata("annotationOnParameter_parameterProperty.kt")
public void testAnnotationOnParameter_parameterProperty() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnParameter_parameterProperty.kt");
}
@Test
@TestMetadata("annotationOnParameter_reified.kt")
public void testAnnotationOnParameter_reified() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnParameter_reified.kt");
}
@Test
@TestMetadata("annotationOnParameter_setparam.kt")
public void testAnnotationOnParameter_setparam() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnParameter_setparam.kt");
}
@Test
@TestMetadata("annotationOnProperty_field.kt")
public void testAnnotationOnProperty_field() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnProperty_field.kt");
}
@Test
@TestMetadata("annotationOnProperty_get.kt")
public void testAnnotationOnProperty_get() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnProperty_get.kt");
}
@Test
@TestMetadata("annotationOnProperty_property.kt")
public void testAnnotationOnProperty_property() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnProperty_property.kt");
}
@Test
@TestMetadata("annotationOnProperty_set.kt")
public void testAnnotationOnProperty_set() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnProperty_set.kt");
}
@Test
@TestMetadata("annotationOnReceiver.kt")
public void testAnnotationOnReceiver() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnReceiver.kt");
}
@Test
@TestMetadata("arrayOfInAnnotation.kt")
public void testArrayOfInAnnotation() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/arrayOfInAnnotation.kt");
}
@Test
@TestMetadata("calleeExpressionOfImplicitInvoke.kt")
public void testCalleeExpressionOfImplicitInvoke() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/calleeExpressionOfImplicitInvoke.kt");
}
@Test
@TestMetadata("checkNotNullCall.kt")
public void testCheckNotNullCall() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/checkNotNullCall.kt");
}
@Test
@TestMetadata("checkNotNullCallAsCallee.kt")
public void testCheckNotNullCallAsCallee() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/checkNotNullCallAsCallee.kt");
}
@Test
@TestMetadata("comparisonCall.kt")
public void testComparisonCall() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/comparisonCall.kt");
}
@Test
@TestMetadata("compoundAssignOnVal.kt")
public void testCompoundAssignOnVal() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVal.kt");
}
@Test
@TestMetadata("compoundAssignOnVal_lhs.kt")
public void testCompoundAssignOnVal_lhs() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVal_lhs.kt");
}
@Test
@TestMetadata("compoundAssignOnVar.kt")
public void testCompoundAssignOnVar() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVar.kt");
}
@Test
@TestMetadata("compoundAssignOnVar_lhs.kt")
public void testCompoundAssignOnVar_lhs() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVar_lhs.kt");
}
@Test
@TestMetadata("compoundAssignWithArrayAccessConvention.kt")
public void testCompoundAssignWithArrayAccessConvention() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention.kt");
}
@Test
@TestMetadata("compoundAssignWithArrayAccessConvention_complexReceivers.kt")
public void testCompoundAssignWithArrayAccessConvention_complexReceivers() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention_complexReceivers.kt");
}
@Test
@TestMetadata("compoundAssignWithArrayAccessConvention_lhs.kt")
public void testCompoundAssignWithArrayAccessConvention_lhs() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention_lhs.kt");
}
@Test
@TestMetadata("compoundAssignWithArrayGetConvention.kt")
public void testCompoundAssignWithArrayGetConvention() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayGetConvention.kt");
}
@Test
@TestMetadata("compoundAssignWithArrayGetConvention_lhs.kt")
public void testCompoundAssignWithArrayGetConvention_lhs() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayGetConvention_lhs.kt");
}
@Test
@TestMetadata("consecutiveImplicitInvoke1.kt")
public void testConsecutiveImplicitInvoke1() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke1.kt");
}
@Test
@TestMetadata("consecutiveImplicitInvoke2.kt")
public void testConsecutiveImplicitInvoke2() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke2.kt");
}
@Test
@TestMetadata("consecutiveImplicitInvoke3.kt")
public void testConsecutiveImplicitInvoke3() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke3.kt");
}
@Test
@TestMetadata("consecutiveImplicitInvoke_callee.kt")
public void testConsecutiveImplicitInvoke_callee() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke_callee.kt");
}
@Test
@TestMetadata("delegatedConstructorCall_super.kt")
public void testDelegatedConstructorCall_super() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_super.kt");
}
@Test
@TestMetadata("delegatedConstructorCall_super_unresolved.kt")
public void testDelegatedConstructorCall_super_unresolved() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_super_unresolved.kt");
}
@Test
@TestMetadata("delegatedConstructorCall_this.kt")
public void testDelegatedConstructorCall_this() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_this.kt");
}
@Test
@TestMetadata("delegatedConstructorCall_this_unresolved.kt")
public void testDelegatedConstructorCall_this_unresolved() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_this_unresolved.kt");
}
@Test
@TestMetadata("enumAsAnnotationValue.kt")
public void testEnumAsAnnotationValue() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/enumAsAnnotationValue.kt");
}
@Test
@TestMetadata("eqEqCall_fromAny.kt")
public void testEqEqCall_fromAny() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromAny.kt");
}
@Test
@TestMetadata("eqEqCall_fromSuperType.kt")
public void testEqEqCall_fromSuperType() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromSuperType.kt");
}
@Test
@TestMetadata("eqEqCall_overridden.kt")
public void testEqEqCall_overridden() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_overridden.kt");
}
@Test
@TestMetadata("functionCallInTheSameFile.kt")
public void testFunctionCallInTheSameFile() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallInTheSameFile.kt");
}
@Test
@TestMetadata("functionCallWithExtensionReceiverAndTypeArgument.kt")
public void testFunctionCallWithExtensionReceiverAndTypeArgument() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithExtensionReceiverAndTypeArgument.kt");
}
@Test
@TestMetadata("functionCallWithLambdaArgument.kt")
public void testFunctionCallWithLambdaArgument() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithLambdaArgument.kt");
}
@Test
@TestMetadata("functionCallWithNamedArgument.kt")
public void testFunctionCallWithNamedArgument() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithNamedArgument.kt");
}
@Test
@TestMetadata("functionCallWithNonTrailingLambdaArgument.kt")
public void testFunctionCallWithNonTrailingLambdaArgument() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithNonTrailingLambdaArgument.kt");
}
@Test
@TestMetadata("functionCallWithSpreadArgument.kt")
public void testFunctionCallWithSpreadArgument() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithSpreadArgument.kt");
}
@Test
@TestMetadata("functionCallWithTypeArgument.kt")
public void testFunctionCallWithTypeArgument() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithTypeArgument.kt");
}
@Test
@TestMetadata("functionCallWithVarargArgument.kt")
public void testFunctionCallWithVarargArgument() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithVarargArgument.kt");
}
@Test
@TestMetadata("functionTypeVariableCall_dispatchReceiver.kt")
public void testFunctionTypeVariableCall_dispatchReceiver() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/functionTypeVariableCall_dispatchReceiver.kt");
}
@Test
@TestMetadata("functionTypeVariableCall_extensionReceiver.kt")
public void testFunctionTypeVariableCall_extensionReceiver() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/functionTypeVariableCall_extensionReceiver.kt");
}
@Test
@TestMetadata("functionWithReceiverCall.kt")
public void testFunctionWithReceiverCall() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/functionWithReceiverCall.kt");
}
@Test
@TestMetadata("functionWithReceiverSafeCall.kt")
public void testFunctionWithReceiverSafeCall() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/functionWithReceiverSafeCall.kt");
}
@Test
@TestMetadata("hiddenConstructor.kt")
public void testHiddenConstructor() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/hiddenConstructor.kt");
}
@Test
@TestMetadata("hiddenDeprecated.kt")
public void testHiddenDeprecated() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/hiddenDeprecated.kt");
}
@Test
@TestMetadata("implicitConstructorDelegationCall.kt")
public void testImplicitConstructorDelegationCall() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/implicitConstructorDelegationCall.kt");
}
@Test
@TestMetadata("implicitConstuctorCall.kt")
public void testImplicitConstuctorCall() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/implicitConstuctorCall.kt");
}
@Test
@TestMetadata("implicitJavaConstuctorCall.kt")
public void testImplicitJavaConstuctorCall() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/implicitJavaConstuctorCall.kt");
}
@Test
@TestMetadata("indexedGet.kt")
public void testIndexedGet() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/indexedGet.kt");
}
@Test
@TestMetadata("indexedGetWithNotEnoughArgs.kt")
public void testIndexedGetWithNotEnoughArgs() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/indexedGetWithNotEnoughArgs.kt");
}
@Test
@TestMetadata("indexedGetWithTooManyArgs.kt")
public void testIndexedGetWithTooManyArgs() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/indexedGetWithTooManyArgs.kt");
}
@Test
@TestMetadata("indexedSet.kt")
public void testIndexedSet() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/indexedSet.kt");
}
@Test
@TestMetadata("indexedSetWithNotEnoughArgs.kt")
public void testIndexedSetWithNotEnoughArgs() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/indexedSetWithNotEnoughArgs.kt");
}
@Test
@TestMetadata("indexedSetWithTooManyArgs.kt")
public void testIndexedSetWithTooManyArgs() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/indexedSetWithTooManyArgs.kt");
}
@Test
@TestMetadata("intArrayOfInAnnotation.kt")
public void testIntArrayOfInAnnotation() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/intArrayOfInAnnotation.kt");
}
@Test
@TestMetadata("javaFunctionCall.kt")
public void testJavaFunctionCall() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/javaFunctionCall.kt");
}
@Test
@TestMetadata("javaPropertyGetter.kt")
public void testJavaPropertyGetter() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertyGetter.kt");
}
@Test
@TestMetadata("javaPropertyGetter_unqualified.kt")
public void testJavaPropertyGetter_unqualified() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertyGetter_unqualified.kt");
}
@Test
@TestMetadata("javaPropertyNestedGetter.kt")
public void testJavaPropertyNestedGetter() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertyNestedGetter.kt");
}
@Test
@TestMetadata("javaPropertySetter.kt")
public void testJavaPropertySetter() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertySetter.kt");
}
@Test
@TestMetadata("javaPropertySetterIncomplete.kt")
public void testJavaPropertySetterIncomplete() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertySetterIncomplete.kt");
}
@Test
@TestMetadata("javaPropertySetter_unqualified.kt")
public void testJavaPropertySetter_unqualified() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertySetter_unqualified.kt");
}
@Test
@TestMetadata("kotlinPropertyGetter.kt")
public void testKotlinPropertyGetter() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertyGetter.kt");
}
@Test
@TestMetadata("kotlinPropertyGetter_unqualified.kt")
public void testKotlinPropertyGetter_unqualified() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertyGetter_unqualified.kt");
}
@Test
@TestMetadata("kotlinPropertyNestedGetter.kt")
public void testKotlinPropertyNestedGetter() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertyNestedGetter.kt");
}
@Test
@TestMetadata("kotlinPropertySetter.kt")
public void testKotlinPropertySetter() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertySetter.kt");
}
@Test
@TestMetadata("kotlinPropertySetter_unqualified.kt")
public void testKotlinPropertySetter_unqualified() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertySetter_unqualified.kt");
}
@Test
@TestMetadata("memberFunctionCallWithTypeArgument.kt")
public void testMemberFunctionCallWithTypeArgument() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/memberFunctionCallWithTypeArgument.kt");
}
@Test
@TestMetadata("postfixUnaryOperatorOnVar.kt")
public void testPostfixUnaryOperatorOnVar() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorOnVar.kt");
}
@Test
@TestMetadata("postfixUnaryOperatorOnVar_base.kt")
public void testPostfixUnaryOperatorOnVar_base() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorOnVar_base.kt");
}
@Test
@TestMetadata("postfixUnaryOperatorWithArrayAccessConvention.kt")
public void testPostfixUnaryOperatorWithArrayAccessConvention() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention.kt");
}
@Test
@TestMetadata("postfixUnaryOperatorWithArrayAccessConvention_base.kt")
public void testPostfixUnaryOperatorWithArrayAccessConvention_base() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention_base.kt");
}
@Test
@TestMetadata("postfixUnaryOperatorWithArrayAccessConvention_complexDispatcher.kt")
public void testPostfixUnaryOperatorWithArrayAccessConvention_complexDispatcher() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention_complexDispatcher.kt");
}
@Test
@TestMetadata("prefixUnaryOperatorOnVar.kt")
public void testPrefixUnaryOperatorOnVar() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorOnVar.kt");
}
@Test
@TestMetadata("prefixUnaryOperatorOnVar_base.kt")
public void testPrefixUnaryOperatorOnVar_base() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorOnVar_base.kt");
}
@Test
@TestMetadata("prefixUnaryOperatorWithArrayAccessConvention.kt")
public void testPrefixUnaryOperatorWithArrayAccessConvention() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention.kt");
}
@Test
@TestMetadata("prefixUnaryOperatorWithArrayAccessConvention_base.kt")
public void testPrefixUnaryOperatorWithArrayAccessConvention_base() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention_base.kt");
}
@Test
@TestMetadata("prefixUnaryOperatorWithArrayAccessConvention_complexDispatcher.kt")
public void testPrefixUnaryOperatorWithArrayAccessConvention_complexDispatcher() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention_complexDispatcher.kt");
}
@Test
@TestMetadata("privateMember.kt")
public void testPrivateMember() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/privateMember.kt");
}
@Test
@TestMetadata("qualifiedCalleeExpressionOfImplicitInvoke.kt")
public void testQualifiedCalleeExpressionOfImplicitInvoke() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/qualifiedCalleeExpressionOfImplicitInvoke.kt");
}
@Test
@TestMetadata("resolveCallInSuperConstructorParam.kt")
public void testResolveCallInSuperConstructorParam() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/resolveCallInSuperConstructorParam.kt");
}
@Test
@TestMetadata("samConstructorCall.kt")
public void testSamConstructorCall() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/samConstructorCall.kt");
}
@Test
@TestMetadata("simpleCallWithNonMatchingArgs.kt")
public void testSimpleCallWithNonMatchingArgs() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/simpleCallWithNonMatchingArgs.kt");
}
@Test
@TestMetadata("smartCastExplicitDispatchReceiver.kt")
public void testSmartCastExplicitDispatchReceiver() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastExplicitDispatchReceiver.kt");
}
@Test
@TestMetadata("smartCastExplicitExtensionReceiver.kt")
public void testSmartCastExplicitExtensionReceiver() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastExplicitExtensionReceiver.kt");
}
@Test
@TestMetadata("smartCastImplicitDispatchReceiver.kt")
public void testSmartCastImplicitDispatchReceiver() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastImplicitDispatchReceiver.kt");
}
@Test
@TestMetadata("smartCastImplicitExtensionReceiver.kt")
public void testSmartCastImplicitExtensionReceiver() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastImplicitExtensionReceiver.kt");
}
@Test
@TestMetadata("unresolvedSuperReference.kt")
public void testUnresolvedSuperReference() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/unresolvedSuperReference.kt");
}
@Test
@TestMetadata("variableAsFunction.kt")
public void testVariableAsFunction() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunction.kt");
}
@Test
@TestMetadata("variableAsFunctionLikeCall.kt")
public void testVariableAsFunctionLikeCall() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionLikeCall.kt");
}
@Test
@TestMetadata("variableAsFunctionWithParameterName.kt")
public void testVariableAsFunctionWithParameterName() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterName.kt");
}
@Test
@TestMetadata("variableAsFunctionWithParameterNameAnnotation.kt")
public void testVariableAsFunctionWithParameterNameAnnotation() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameAnnotation.kt");
}
@Test
@TestMetadata("variableAsFunctionWithParameterNameAnnotationConflict.kt")
public void testVariableAsFunctionWithParameterNameAnnotationConflict() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameAnnotationConflict.kt");
}
@Test
@TestMetadata("variableAsFunctionWithParameterNameGeneric.kt")
public void testVariableAsFunctionWithParameterNameGeneric() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameGeneric.kt");
}
@Test
@TestMetadata("variableAsFunctionWithParameterNameInNonFunctionType.kt")
public void testVariableAsFunctionWithParameterNameInNonFunctionType() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameInNonFunctionType.kt");
}
@Test
@TestMetadata("variableAsFunctionWithParameterNameMixed.kt")
public void testVariableAsFunctionWithParameterNameMixed() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameMixed.kt");
}
@Test
@TestMetadata("variableWithExtensionInvoke.kt")
public void testVariableWithExtensionInvoke() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithExtensionInvoke.kt");
}
@Test
@TestMetadata("variableWithInvokeFunctionCall_dispatchReceiver.kt")
public void testVariableWithInvokeFunctionCall_dispatchReceiver() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithInvokeFunctionCall_dispatchReceiver.kt");
}
@Test
@TestMetadata("variableWithInvokeFunctionCall_extensionReceiver.kt")
public void testVariableWithInvokeFunctionCall_extensionReceiver() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithInvokeFunctionCall_extensionReceiver.kt");
}
@Test
@TestMetadata("variableWithMemberInvoke.kt")
public void testVariableWithMemberInvoke() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithMemberInvoke.kt");
}
}
@@ -0,0 +1,57 @@
KtSuccessCallInfo:
call = KtCompoundArrayAccessCall:
compoundAccess = CompoundAssign:
kind = PLUS_ASSIGN
operand = 1
operationPartiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = m["a"]
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = kotlin/Int.plus(<dispatch receiver>: kotlin.Int, other: kotlin.Int): kotlin.Int
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = other: kotlin.Int
]
getPartiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = m
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = /MyMap.get(<dispatch receiver>: MyMap<K, V>, k: K): V
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = k: K
]
indexArguments = [
"a"
]
setPartiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = m
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /MyMap.set(<dispatch receiver>: MyMap<K, V>, k: K, v: V): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = k: K,
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = v: V
]
@@ -0,0 +1,76 @@
KtSuccessCallInfo:
call = KtCompoundArrayAccessCall:
compoundAccess = CompoundAssign:
kind = PLUS_ASSIGN
operand = 1
operationPartiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = m["a"]
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = kotlin/Int.plus(<dispatch receiver>: kotlin.Int, other: kotlin.Int): kotlin.Int
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = other: kotlin.Int
]
getPartiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = m
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = /MyMap.get(<dispatch receiver>: MyMap<K1, V1>, k: K1): V1
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = k: K1
]
indexArguments = [
"a"
]
setPartiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtImplicitReceiverValue:
symbol = KtNamedClassOrObjectSymbol:
annotationsList: []
classIdIfNonLocal: Foo
classKind: INTERFACE
companionObject: null
isData: false
isExternal: false
isFun: false
isInline: false
isInner: false
modality: ABSTRACT
name: Foo
origin: LIBRARY
superTypes: [
kotlin/Any
]
symbolKind: TOP_LEVEL
typeParameters: []
visibility: Public
extensionReceiver = KtExplicitReceiverValue:
expression = m
isSafeNavigation = false
signature = KtFunctionLikeSignature:
receiverType = MyMap<kotlin.String, kotlin.Int>
returnType = kotlin.Unit
symbol = /Foo.set(<extension receiver>: MyMap<K2, V2>, <dispatch receiver>: Foo, k: K2, v: V2): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = k: K2,
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = v: V2
]
@@ -0,0 +1,24 @@
KtSuccessCallInfo:
call = KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = m
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = /MyMap.get(<dispatch receiver>: MyMap<K, V>, k: K): V
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = k: K
]
argumentMapping = {
"a" -> (KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = k: K)
}
@@ -0,0 +1,24 @@
KtSuccessCallInfo:
call = KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = m
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = A
symbol = /MyMap.get(<dispatch receiver>: MyMap<K, V>, k: K): V
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = k: K
]
argumentMapping = {
"a" -> (KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = k: K)
}
@@ -1,4 +1,25 @@
KtDelegatedConstructorCall: KtErrorCallInfo:
argumentMapping = { s -> (p1: kotlin.Int) } candidateCalls = [
targetFunction = ERR<Unresolved call, [<constructor>(p1: kotlin.Int): Base]> KtDelegatedConstructorCall:
kind = SUPER_CALL kind = SUPER_CALL
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = Base
symbol = <constructor>(p1: kotlin.Int): Base
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = p1: kotlin.Int
]
argumentMapping = {
s -> (KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = p1: kotlin.Int)
}
]
diagnostic = ERROR<TYPE_MISMATCH: Type mismatch: inferred type is String but Int was expected>
@@ -1,4 +1,56 @@
KtDelegatedConstructorCall: KtErrorCallInfo:
argumentMapping = { } candidateCalls = [
targetFunction = ERR<Unresolved call, []> KtDelegatedConstructorCall:
kind = THIS_CALL kind = THIS_CALL
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = Sub
symbol = <constructor>(i: kotlin.Int, j: kotlin.Int): Sub
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = i: kotlin.Int,
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = j: kotlin.Int
]
argumentMapping = {
i -> (KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = i: kotlin.Int),
j -> (KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = j: kotlin.Int)
},
KtDelegatedConstructorCall:
kind = THIS_CALL
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = Sub
symbol = <constructor>(p: kotlin.Int): Sub
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = p: kotlin.Int
]
argumentMapping = {
i -> (KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = p: kotlin.Int)
}
]
diagnostic = ERROR<NONE_APPLICABLE: None of the following functions can be called with the arguments supplied:
public constructor Sub(p: Int) defined in Sub
public constructor Sub(i: Int, j: Int) defined in Sub>
@@ -0,0 +1,16 @@
KtSuccessCallInfo:
call = KtSimpleFunctionCall:
isImplicitInvoke = true
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = f
isSafeNavigation = false
extensionReceiver = KtExplicitReceiverValue:
expression = ""
isSafeNavigation = false
signature = KtFunctionLikeSignature:
receiverType = kotlin.String
returnType = kotlin.Unit
symbol = kotlin/Function1.invoke(<extension receiver>: P1<dispatch receiver>: kotlin.Function1<P1, R>): R
valueParameters = []
argumentMapping = {}
@@ -0,0 +1,16 @@
KtSuccessCallInfo:
call = KtSimpleFunctionCall:
isImplicitInvoke = true
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = f
isSafeNavigation = false
extensionReceiver = KtExplicitReceiverValue:
expression = ""
isSafeNavigation = false
signature = KtFunctionLikeSignature:
receiverType = kotlin.String
returnType = kotlin.Unit
symbol = kotlin/Function1.invoke(<extension receiver>: P1<dispatch receiver>: kotlin.Function1<P1, R>): R
valueParameters = []
argumentMapping = {}
@@ -0,0 +1,3 @@
KtErrorCallInfo:
candidateCalls = []
diagnostic = ERROR<FUNCTION_EXPECTED: Expression 'Obj' of type 'Obj' cannot be invoked as a function. The function 'invoke()' is not found>
@@ -1,4 +0,0 @@
KtFunctionCall:
argumentMapping = { 1 -> (a: kotlin.Int) }
targetFunction = ERR<Unresolved call, [/C.get(<dispatch receiver>: C, a: kotlin.Int, b: kotlin.String): kotlin.Boolean]>
substitutor = <empty substitutor>
@@ -1,4 +1,35 @@
KtFunctionCall: KtErrorCallInfo:
argumentMapping = { 1 -> (a: kotlin.Int), "foo" -> (b: kotlin.String) } candidateCalls = [
targetFunction = ERR<Unresolved call, [/C.get(<dispatch receiver>: C, a: kotlin.Int, b: kotlin.String): kotlin.Boolean]> KtSimpleFunctionCall:
substitutor = <empty substitutor> isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = c
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Boolean
symbol = /C.get(<dispatch receiver>: C, a: kotlin.Int, b: kotlin.String): kotlin.Boolean
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = a: kotlin.Int,
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = b: kotlin.String
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = a: kotlin.Int),
"foo" -> (KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = b: kotlin.String)
}
]
diagnostic = ERROR<TOO_MANY_ARGUMENTS: Too many arguments for public final operator fun get(a: Int, b: String): Boolean defined in C>
@@ -1,4 +0,0 @@
KtFunctionCall:
argumentMapping = { 1 -> (a: kotlin.Int), false -> (value: kotlin.Boolean) }
targetFunction = ERR<Unresolved call, [/C.set(<dispatch receiver>: C, a: kotlin.Int, b: kotlin.String, value: kotlin.Boolean): kotlin.Unit]>
substitutor = <empty substitutor>
@@ -1,4 +1,43 @@
KtFunctionCall: KtErrorCallInfo:
argumentMapping = { 1 -> (a: kotlin.Int), "foo" -> (b: kotlin.String), 3.14 -> (value: kotlin.Boolean) } candidateCalls = [
targetFunction = ERR<Unresolved call, [/C.set(<dispatch receiver>: C, a: kotlin.Int, b: kotlin.String, value: kotlin.Boolean): kotlin.Unit]> KtSimpleFunctionCall:
substitutor = <empty substitutor> isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = c
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /C.set(<dispatch receiver>: C, a: kotlin.Int, b: kotlin.String, value: kotlin.Boolean): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = a: kotlin.Int,
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = b: kotlin.String,
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Boolean
symbol = value: kotlin.Boolean
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = a: kotlin.Int),
"foo" -> (KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = b: kotlin.String),
3.14 -> (KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Boolean
symbol = value: kotlin.Boolean)
}
]
diagnostic = ERROR<TOO_MANY_ARGUMENTS: Too many arguments for public final operator fun set(a: Int, b: String, value: Boolean): Unit defined in C>
@@ -1,4 +0,0 @@
KtFunctionCall:
argumentMapping = { }
targetFunction = <getter>(<dispatch receiver>: KtClass): kotlin.Int
substitutor = <empty substitutor>
@@ -1,4 +0,0 @@
KtFunctionCall:
argumentMapping = { 1 -> (r: kotlin.Int) }
targetFunction = /A.foo(<dispatch receiver>: A<kotlin.String>, r: kotlin.Int): kotlin.Unit
substitutor = <map substitutor: {R = kotlin/Int}>
@@ -0,0 +1,52 @@
KtSuccessCallInfo:
call = KtCompoundArrayAccessCall:
compoundAccess = IncOrDecOperation:
kind = INC
precedence = POSTFIX
operationPartiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = m["a"]
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = kotlin/Int.inc(<dispatch receiver>: kotlin.Int): kotlin.Int
valueParameters = []
getPartiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = m
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = /MyMap.get(<dispatch receiver>: MyMap<K, V>, k: K): V
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = k: K
]
indexArguments = [
"a"
]
setPartiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = m
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /MyMap.set(<dispatch receiver>: MyMap<K, V>, k: K, v: V): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = k: K,
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = v: V
]
@@ -0,0 +1,24 @@
KtSuccessCallInfo:
call = KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = m
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = /MyMap.get(<dispatch receiver>: MyMap<K, V>, k: K): V
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = k: K
]
argumentMapping = {
"a" -> (KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = k: K)
}
@@ -0,0 +1,71 @@
KtSuccessCallInfo:
call = KtCompoundArrayAccessCall:
compoundAccess = IncOrDecOperation:
kind = INC
precedence = POSTFIX
operationPartiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = m["a"]
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = kotlin/Int.inc(<dispatch receiver>: kotlin.Int): kotlin.Int
valueParameters = []
getPartiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = m
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = /MyMap.get(<dispatch receiver>: MyMap<K1, V1>, k: K1): V1
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = k: K1
]
indexArguments = [
"a"
]
setPartiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtImplicitReceiverValue:
symbol = KtNamedClassOrObjectSymbol:
annotationsList: []
classIdIfNonLocal: Foo
classKind: INTERFACE
companionObject: null
isData: false
isExternal: false
isFun: false
isInline: false
isInner: false
modality: ABSTRACT
name: Foo
origin: LIBRARY
superTypes: [
kotlin/Any
]
symbolKind: TOP_LEVEL
typeParameters: []
visibility: Public
extensionReceiver = KtExplicitReceiverValue:
expression = m
isSafeNavigation = false
signature = KtFunctionLikeSignature:
receiverType = MyMap<kotlin.String, kotlin.Int>
returnType = kotlin.Unit
symbol = /Foo.set(<extension receiver>: MyMap<K2, V2>, <dispatch receiver>: Foo, k: K2, v: V2): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = k: K2,
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = v: V2
]
@@ -0,0 +1,52 @@
KtSuccessCallInfo:
call = KtCompoundArrayAccessCall:
compoundAccess = IncOrDecOperation:
kind = INC
precedence = PREFIX
operationPartiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = m["a"]
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = kotlin/Int.inc(<dispatch receiver>: kotlin.Int): kotlin.Int
valueParameters = []
getPartiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = m
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = /MyMap.get(<dispatch receiver>: MyMap<K, V>, k: K): V
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = k: K
]
indexArguments = [
"a"
]
setPartiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = m
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /MyMap.set(<dispatch receiver>: MyMap<K, V>, k: K, v: V): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = k: K,
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = v: V
]
@@ -0,0 +1,24 @@
KtSuccessCallInfo:
call = KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = m
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = /MyMap.get(<dispatch receiver>: MyMap<K, V>, k: K): V
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = k: K
]
argumentMapping = {
"a" -> (KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = k: K)
}
@@ -0,0 +1,71 @@
KtSuccessCallInfo:
call = KtCompoundArrayAccessCall:
compoundAccess = IncOrDecOperation:
kind = INC
precedence = PREFIX
operationPartiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = m["a"]
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = kotlin/Int.inc(<dispatch receiver>: kotlin.Int): kotlin.Int
valueParameters = []
getPartiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = m
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = /MyMap.get(<dispatch receiver>: MyMap<K1, V1>, k: K1): V1
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = k: K1
]
indexArguments = [
"a"
]
setPartiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtImplicitReceiverValue:
symbol = KtNamedClassOrObjectSymbol:
annotationsList: []
classIdIfNonLocal: Foo
classKind: INTERFACE
companionObject: null
isData: false
isExternal: false
isFun: false
isInline: false
isInner: false
modality: ABSTRACT
name: Foo
origin: LIBRARY
superTypes: [
kotlin/Any
]
symbolKind: TOP_LEVEL
typeParameters: []
visibility: Public
extensionReceiver = KtExplicitReceiverValue:
expression = m
isSafeNavigation = false
signature = KtFunctionLikeSignature:
receiverType = MyMap<kotlin.String, kotlin.Int>
returnType = kotlin.Unit
symbol = /Foo.set(<extension receiver>: MyMap<K2, V2>, <dispatch receiver>: Foo, k: K2, v: V2): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = k: K2,
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = v: V2
]
@@ -0,0 +1,17 @@
KtErrorCallInfo:
candidateCalls = [
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = a
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /A.foo(<dispatch receiver>: A): kotlin.Unit
valueParameters = []
argumentMapping = {}
]
diagnostic = ERROR<INVISIBLE_MEMBER: Cannot access 'foo': it is private in 'A'>
@@ -1,4 +1,15 @@
KtFunctionCall: KtErrorCallInfo:
argumentMapping = { } candidateCalls = [
targetFunction = ERR<Unresolved call, [/foo(): kotlin.Unit]> KtSimpleFunctionCall:
substitutor = <empty substitutor> isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /foo(): kotlin.Unit
valueParameters = []
argumentMapping = {}
]
diagnostic = ERROR<TOO_MANY_ARGUMENTS: Too many arguments for public fun foo(): Unit defined in root package in file simpleCallWithNonMatchingArgs.kt>
@@ -1,4 +0,0 @@
KtDelegatedConstructorCall:
argumentMapping = { }
targetFunction = ERR<Unresolved call, []>
kind = SUPER_CALL
@@ -0,0 +1,24 @@
KtSuccessCallInfo:
call = KtSimpleFunctionCall:
isImplicitInvoke = true
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = x
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = kotlin/Function1.invoke(<dispatch receiver>: kotlin.Function1<P1, R>, p1: P1): R
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = p1: P1
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = p1: P1)
}
@@ -0,0 +1,23 @@
KtSuccessCallInfo:
call = KtSimpleFunctionCall:
isImplicitInvoke = true
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = x
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = kotlin/Function2.invoke(<dispatch receiver>: kotlin.Function2<P1, P2, R>, p1: P1, p2: P2): R
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = @R|kotlin.ParameterName|(name = String(a)) kotlin.Int
symbol = p1: P1,
KtVariableLikeSignature:
receiverType = null
returnType = @R|kotlin.ParameterName|(name = String(b)) kotlin.String
symbol = p2: P2
]
argumentMapping = {}
@@ -0,0 +1,23 @@
KtSuccessCallInfo:
call = KtSimpleFunctionCall:
isImplicitInvoke = true
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = x
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = kotlin/Function2.invoke(<dispatch receiver>: kotlin.Function2<P1, P2, R>, p1: P1, p2: P2): R
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = @R|kotlin.ParameterName|(name = String(a)) kotlin.Int
symbol = p1: P1,
KtVariableLikeSignature:
receiverType = null
returnType = @R|kotlin.ParameterName|(name = String(b)) kotlin.String
symbol = p2: P2
]
argumentMapping = {}
@@ -1,5 +1,23 @@
KtFunctionalTypeVariableCall: KtSuccessCallInfo:
target = x: kotlin.Function2<@R|kotlin.ParameterName|(name = String(a)) @R|kotlin.ParameterName|(name = String(notMe)) kotlin.Int, @R|kotlin.ParameterName|(name = String(b)) @R|kotlin.ParameterName|(name = String(meNeither)) kotlin.String, kotlin.Unit> call = KtSimpleFunctionCall:
argumentMapping = { 1 -> (a: @R|kotlin.ParameterName|(name = String(a)) @R|kotlin.ParameterName|(name = String(notMe)) kotlin.Int), "" -> (b: @R|kotlin.ParameterName|(name = String(b)) @R|kotlin.ParameterName|(name = String(meNeither)) kotlin.String) } isImplicitInvoke = true
targetFunction = kotlin/Function2.invoke(<dispatch receiver>: kotlin.Function2<@R|kotlin.ParameterName|(name = String(a)) @R|kotlin.ParameterName|(name = String(notMe)) kotlin.Int, @R|kotlin.ParameterName|(name = String(b)) @R|kotlin.ParameterName|(name = String(meNeither)) kotlin.String, kotlin.Unit>, a: @R|kotlin.ParameterName|(name = String(a)) @R|kotlin.ParameterName|(name = String(notMe)) kotlin.Int, b: @R|kotlin.ParameterName|(name = String(b)) @R|kotlin.ParameterName|(name = String(meNeither)) kotlin.String): kotlin.Unit partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
substitutor = <empty substitutor> dispatchReceiver = KtExplicitReceiverValue:
expression = x
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = kotlin/Function2.invoke(<dispatch receiver>: kotlin.Function2<P1, P2, R>, p1: P1, p2: P2): R
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = @R|kotlin.ParameterName|(name = String(a)) @R|kotlin.ParameterName|(name = String(notMe)) kotlin.Int
symbol = p1: P1,
KtVariableLikeSignature:
receiverType = null
returnType = @R|kotlin.ParameterName|(name = String(b)) @R|kotlin.ParameterName|(name = String(meNeither)) kotlin.String
symbol = p2: P2
]
argumentMapping = {}
@@ -0,0 +1,19 @@
KtSuccessCallInfo:
call = KtSimpleFunctionCall:
isImplicitInvoke = true
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = x
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = kotlin/Function1.invoke(<dispatch receiver>: kotlin.Function1<P1, R>, p1: P1): R
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = @R|kotlin.ParameterName|(name = String(a)) kotlin.Int
symbol = p1: P1
]
argumentMapping = {}
@@ -0,0 +1,28 @@
KtSuccessCallInfo:
call = KtSimpleFunctionCall:
isImplicitInvoke = true
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = x
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = kotlin/Function2.invoke(<dispatch receiver>: kotlin.Function2<P1, P2, R>, p1: P1, p2: P2): R
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = @R|kotlin.ParameterName|(name = String(a)) kotlin.Int
symbol = p1: P1,
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = p2: P2
]
argumentMapping = {
"" -> (KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = p2: P2)
}
@@ -0,0 +1,19 @@
KtSuccessCallInfo:
call = KtSimpleFunctionCall:
isImplicitInvoke = true
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = x
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = kotlin/Function1.invoke(<dispatch receiver>: kotlin.Function1<P1, R>, p1: P1): R
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = @R|kotlin.ParameterName|(name = String(a)) kotlin.Int
symbol = p1: P1
]
argumentMapping = {}
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.generators.tests.analysis.api
import org.jetbrains.kotlin.analysis.api.descriptors.test.annotations.AbstractAnalysisApiFe10AnnotationsOnDeclarationsTest import org.jetbrains.kotlin.analysis.api.descriptors.test.annotations.AbstractAnalysisApiFe10AnnotationsOnDeclarationsTest
import org.jetbrains.kotlin.analysis.api.descriptors.test.annotations.AbstractAnalysisApiFe10AnnotationsOnTypesTest import org.jetbrains.kotlin.analysis.api.descriptors.test.annotations.AbstractAnalysisApiFe10AnnotationsOnTypesTest
import org.jetbrains.kotlin.analysis.api.descriptors.test.components.callResolver.AbstractKtFe10ResolveCallTest
import org.jetbrains.kotlin.analysis.api.descriptors.test.components.compileTimeConstantProvider.AbstractKtFe10CompileTimeConstantEvaluatorTest import org.jetbrains.kotlin.analysis.api.descriptors.test.components.compileTimeConstantProvider.AbstractKtFe10CompileTimeConstantEvaluatorTest
import org.jetbrains.kotlin.analysis.api.descriptors.test.components.expressionInfoProvider.AbstractKtFe10ReturnTargetSymbolTest import org.jetbrains.kotlin.analysis.api.descriptors.test.components.expressionInfoProvider.AbstractKtFe10ReturnTargetSymbolTest
import org.jetbrains.kotlin.analysis.api.descriptors.test.components.expressionInfoProvider.AbstractKtFe10WhenMissingCasesTest import org.jetbrains.kotlin.analysis.api.descriptors.test.components.expressionInfoProvider.AbstractKtFe10WhenMissingCasesTest
@@ -148,8 +149,7 @@ private fun TestGroupSuite.generateAnalysisApiComponentsTests() {
component("callResolver") { component("callResolver") {
test( test(
fir = AbstractFirResolveCallTest::class, fir = AbstractFirResolveCallTest::class,
// TODO: re-enable after KtFe10CallResolver is properly implemented fe10 = AbstractKtFe10ResolveCallTest::class,
fe10 = null // AbstractKtFe10ResolveCallTest::class,
) { ) {
model("resolveCall") model("resolveCall")
} }