From 9b050191373b2e8af595d9290a88c8a7b3ab46f3 Mon Sep 17 00:00:00 2001 From: Tianyu Geng Date: Tue, 23 Nov 2021 19:34:55 -0800 Subject: [PATCH] FIR Analysis API: reimplement KtFirCallResolver with new data model --- .../KtFe10ResolveCallTestGenerated.java | 222 +++++ .../KtFirAnalysisSessionComponent.kt | 35 +- .../api/fir/components/KtFirCallResolver.kt | 936 +++++++++++++----- .../KtFirInvokeFunctionReference.kt | 4 +- .../FirResolveCallTestGenerated.java | 252 +++++ .../base/components/AbstractKtCallResolver.kt | 45 +- .../base/test/fir/AbstractResolveCallTest.kt | 146 +-- .../analysis/api/components/KtCallResolver.kt | 5 +- .../resolveCall/annotationEntry.txt | 24 +- .../annotationInAnnotation_arrayOf.txt | 26 +- ...notationInAnnotation_collectionLiteral.txt | 26 +- ...Annotation_multipleAnnotations_arrayOf.txt | 30 +- ..._multipleAnnotations_collectionLiteral.txt | 24 +- .../annotationInAnnotation_noarg.txt | 21 +- .../annotationInAnnotation_vararg.txt | 30 +- .../resolveCall/annotationOnDelegate.txt | 19 +- .../annotationOnExpression_asT.txt | 24 +- .../annotationOnExpression_destructuring.txt | 24 +- .../resolveCall/annotationOnExpression_if.txt | 19 +- .../annotationOnExpression_whenBranch.txt | 24 +- .../resolveCall/annotationOnFile.txt | 24 +- .../annotationOnParameter_param.txt | 14 +- ...nnotationOnParameter_parameterProperty.txt | 14 +- .../annotationOnParameter_reified.txt | 24 +- .../annotationOnParameter_setparam.txt | 14 +- .../annotationOnProperty_field.txt | 14 +- .../resolveCall/annotationOnProperty_get.txt | 14 +- .../annotationOnProperty_property.txt | 14 +- .../resolveCall/annotationOnProperty_set.txt | 14 +- .../resolveCall/annotationOnReceiver.txt | 14 +- .../resolveCall/arrayOfInAnnotation.txt | 34 +- .../calleeExpressionOfImplicitInvoke.kt | 3 + .../calleeExpressionOfImplicitInvoke.txt | 10 + .../resolveCall/checkNotNullCall.kt | 3 + .../resolveCall/checkNotNullCall.txt | 3 + .../resolveCall/checkNotNullCallAsCallee.kt | 3 + .../resolveCall/checkNotNullCallAsCallee.txt | 3 + .../resolveCall/comparisonCall.kt | 3 + .../resolveCall/comparisonCall.txt | 24 + .../resolveCall/compoundAssignOnVal.kt | 6 + .../resolveCall/compoundAssignOnVal.txt | 24 + .../resolveCall/compoundAssignOnVal_lhs.kt | 6 + .../resolveCall/compoundAssignOnVal_lhs.txt | 10 + .../resolveCall/compoundAssignOnVar.kt | 4 + .../resolveCall/compoundAssignOnVar.txt | 27 + .../resolveCall/compoundAssignOnVar_lhs.kt | 4 + .../resolveCall/compoundAssignOnVar_lhs.txt | 10 + ...compoundAssignWithArrayAccessConvention.kt | 8 + ...ompoundAssignWithArrayAccessConvention.txt | 57 ++ ...hArrayAccessConvention_complexReceivers.kt | 11 + ...ArrayAccessConvention_complexReceivers.txt | 76 ++ ...oundAssignWithArrayAccessConvention_lhs.kt | 8 + ...undAssignWithArrayAccessConvention_lhs.txt | 24 + .../compoundAssignWithArrayGetConvention.kt | 11 + .../compoundAssignWithArrayGetConvention.txt | 24 + ...ompoundAssignWithArrayGetConvention_lhs.kt | 11 + ...mpoundAssignWithArrayGetConvention_lhs.txt | 24 + .../resolveCall/consecutiveImplicitInvoke1.kt | 6 + .../consecutiveImplicitInvoke1.txt | 14 + .../resolveCall/consecutiveImplicitInvoke2.kt | 6 + .../consecutiveImplicitInvoke2.txt | 14 + .../resolveCall/consecutiveImplicitInvoke3.kt | 6 + .../consecutiveImplicitInvoke3.txt | 14 + .../consecutiveImplicitInvoke_callee.kt | 6 + .../consecutiveImplicitInvoke_callee.txt | 10 + .../delegatedConstructorCall_super.txt | 26 +- ...egatedConstructorCall_super_unresolved.txt | 29 +- .../delegatedConstructorCall_this.txt | 26 +- ...legatedConstructorCall_this_unresolved.txt | 44 +- .../resolveCall/enumAsAnnotationValue.txt | 24 +- .../resolveCall/eqEqCall_fromAny.kt | 5 + .../resolveCall/eqEqCall_fromAny.txt | 24 + .../resolveCall/eqEqCall_fromSuperType.kt | 11 + .../resolveCall/eqEqCall_fromSuperType.txt | 24 + .../resolveCall/eqEqCall_overridden.kt | 9 + .../resolveCall/eqEqCall_overridden.txt | 24 + .../resolveCall/functionCallInTheSameFile.txt | 26 +- ...llWithExtensionReceiverAndTypeArgument.txt | 28 +- .../functionCallWithLambdaArgument.txt | 34 +- .../functionCallWithNamedArgument.txt | 34 +- ...ctionCallWithNonTrailingLambdaArgument.txt | 34 +- .../functionCallWithSpreadArgument.txt | 26 +- .../functionCallWithTypeArgument.txt | 34 +- .../functionCallWithVarargArgument.txt | 34 +- ...nctionTypeVariableCall_dispatchReceiver.kt | 6 + ...ctionTypeVariableCall_dispatchReceiver.txt | 21 + ...ctionTypeVariableCall_extensionReceiver.kt | 7 + ...tionTypeVariableCall_extensionReceiver.txt | 21 + .../resolveCall/functionWithReceiverCall.txt | 28 +- .../functionWithReceiverSafeCall.txt | 28 +- .../resolveCall/hiddenConstructor.kt | 5 + .../resolveCall/hiddenConstructor.txt | 15 + .../resolveCall/hiddenDeprecated.kt | 6 + .../resolveCall/hiddenDeprecated.txt | 3 + .../implicitConstructorDelegationCall.txt | 26 +- .../resolveCall/implicitConstuctorCall.txt | 16 +- .../implicitJavaConstuctorCall.txt | 16 +- .../callResolver/resolveCall/indexedGet.txt | 36 +- .../indexedGetWithNotEnoughArgs.txt | 35 +- .../resolveCall/indexedGetWithTooManyArgs.txt | 39 +- .../callResolver/resolveCall/indexedSet.txt | 44 +- .../indexedSetWithNotEnoughArgs.txt | 43 +- .../resolveCall/indexedSetWithTooManyArgs.txt | 47 +- .../resolveCall/intArrayOfInAnnotation.txt | 34 +- .../resolveCall/javaFunctionCall.txt | 18 +- .../resolveCall/javaPropertyGetter.txt | 16 +- .../javaPropertyGetter_unqualified.txt | 17 +- .../resolveCall/javaPropertyNestedGetter.txt | 16 +- .../resolveCall/javaPropertySetter.txt | 17 +- .../javaPropertySetterIncomplete.txt | 17 +- .../javaPropertySetter_unqualified.txt | 18 +- .../resolveCall/kotlinPropertyGetter.txt | 16 +- .../kotlinPropertyGetter_unqualified.txt | 17 +- .../kotlinPropertyNestedGetter.txt | 16 +- .../resolveCall/kotlinPropertySetter.txt | 17 +- .../kotlinPropertySetter_unqualified.txt | 18 +- .../memberFunctionCallWithTypeArgument.txt | 28 +- .../resolveCall/postfixUnaryOperatorOnVar.kt | 4 + .../resolveCall/postfixUnaryOperatorOnVar.txt | 22 + .../postfixUnaryOperatorOnVar_base.kt | 4 + .../postfixUnaryOperatorOnVar_base.txt | 10 + ...xUnaryOperatorWithArrayAccessConvention.kt | 8 + ...UnaryOperatorWithArrayAccessConvention.txt | 52 + ...yOperatorWithArrayAccessConvention_base.kt | 8 + ...OperatorWithArrayAccessConvention_base.txt | 24 + ...ArrayAccessConvention_complexDispatcher.kt | 11 + ...rrayAccessConvention_complexDispatcher.txt | 71 ++ .../resolveCall/prefixUnaryOperatorOnVar.kt | 4 + .../resolveCall/prefixUnaryOperatorOnVar.txt | 22 + .../prefixUnaryOperatorOnVar_base.kt | 4 + .../prefixUnaryOperatorOnVar_base.txt | 10 + ...xUnaryOperatorWithArrayAccessConvention.kt | 8 + ...UnaryOperatorWithArrayAccessConvention.txt | 52 + ...yOperatorWithArrayAccessConvention_base.kt | 8 + ...OperatorWithArrayAccessConvention_base.txt | 24 + ...ArrayAccessConvention_complexDispatcher.kt | 11 + ...rrayAccessConvention_complexDispatcher.txt | 71 ++ .../callResolver/resolveCall/privateMember.kt | 7 + .../resolveCall/privateMember.txt | 17 + ...alifiedCalleeExpressionOfImplicitInvoke.kt | 6 + ...lifiedCalleeExpressionOfImplicitInvoke.txt | 12 + .../resolveCallInSuperConstructorParam.txt | 28 +- .../resolveCall/samConstructorCall.txt | 26 +- .../simpleCallWithNonMatchingArgs.txt | 19 +- .../smartCastExplicitDispatchReceiver.kt | 5 + .../smartCastExplicitDispatchReceiver.txt | 14 + .../smartCastExplicitExtensionReceiver.kt | 7 + .../smartCastExplicitExtensionReceiver.txt | 16 + .../smartCastImplicitDispatchReceiver.kt | 5 + .../smartCastImplicitDispatchReceiver.txt | 15 + .../smartCastImplicitExtensionReceiver.kt | 7 + .../smartCastImplicitExtensionReceiver.txt | 17 + .../resolveCall/unresolvedSuperReference.txt | 7 +- .../resolveCall/variableAsFunction.txt | 29 +- .../variableAsFunctionLikeCall.txt | 19 +- .../variableAsFunctionWithParameterName.txt | 28 +- ...eAsFunctionWithParameterNameAnnotation.txt | 28 +- ...ionWithParameterNameAnnotationConflict.txt | 28 +- ...ableAsFunctionWithParameterNameGeneric.txt | 24 +- ...tionWithParameterNameInNonFunctionType.txt | 34 +- ...riableAsFunctionWithParameterNameMixed.txt | 33 +- .../variableWithExtensionInvoke.txt | 29 +- ...WithInvokeFunctionCall_dispatchReceiver.kt | 7 + ...ithInvokeFunctionCall_dispatchReceiver.txt | 14 + ...ithInvokeFunctionCall_extensionReceiver.kt | 8 + ...thInvokeFunctionCall_extensionReceiver.txt | 14 + .../resolveCall/variableWithMemberInvoke.txt | 29 +- .../scopes/delegatedMemberScope/simple.txt | 1 + .../delegatedMemberScope/withOverridden.txt | 1 + .../scopes/fileScopeTest/simpleFileScope.txt | 1 + .../scopes/memberScopeByFqName/Int.txt | 61 ++ .../memberScopeByFqName/MutableList.txt | 23 + .../memberScopeByFqName/java.lang.String.txt | 55 + .../memberScopeByFqName/kotlin.Function2.txt | 4 + .../overridenFunctionWithGenericBound.txt | 4 + .../symbolByFqName/fileWalkDirectionEnum.txt | 3 + .../symbols/symbolByFqName/memberFunction.txt | 1 + .../memberFunctionWithOverloads.txt | 2 + .../symbols/symbolByPsi/annotations.txt | 1 + .../symbols/symbolByPsi/anonymousObject.txt | 1 + .../symbols/symbolByPsi/classMembes.txt | 1 + .../symbols/symbolByPsi/deprecated.txt | 2 + .../symbols/symbolByPsi/extensionFunction.txt | 1 + .../symbols/symbolByPsi/forLoopVariable.txt | 1 + .../testData/symbols/symbolByPsi/function.txt | 1 + .../symbolByPsi/functionWithTypeParams.txt | 1 + .../symbols/symbolByPsi/implicitReturn.txt | 1 + .../symbolByPsi/implicitReturnInLambda.txt | 2 + .../symbols/symbolByPsi/localDeclarations.txt | 2 + .../symbols/symbolByPsi/memberFunctions.txt | 2 + .../symbolByPsi/outerAndInnerClasses.txt | 1 + .../symbols/symbolByPsi/topLevelFunctions.txt | 2 + .../symbols/symbolByPsi/typeAnnotations.txt | 1 + .../symbols/symbolByPsi/varargFunctions.txt | 4 + .../genericFromFunctionInLocalClass.txt | 1 + .../genericFromOuterClassInInnerClass.txt | 1 + 196 files changed, 4309 insertions(+), 639 deletions(-) create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/calleeExpressionOfImplicitInvoke.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/calleeExpressionOfImplicitInvoke.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/checkNotNullCall.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/checkNotNullCall.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/checkNotNullCallAsCallee.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/checkNotNullCallAsCallee.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/comparisonCall.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/comparisonCall.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVal.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVal.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVal_lhs.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVal_lhs.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVar.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVar.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVar_lhs.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVar_lhs.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention_complexReceivers.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention_complexReceivers.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention_lhs.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention_lhs.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayGetConvention.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayGetConvention.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayGetConvention_lhs.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayGetConvention_lhs.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke1.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke1.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke2.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke2.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke3.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke3.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke_callee.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke_callee.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromAny.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromAny.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromSuperType.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromSuperType.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_overridden.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_overridden.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/functionTypeVariableCall_dispatchReceiver.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/functionTypeVariableCall_dispatchReceiver.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/functionTypeVariableCall_extensionReceiver.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/functionTypeVariableCall_extensionReceiver.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/hiddenConstructor.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/hiddenConstructor.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/hiddenDeprecated.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/hiddenDeprecated.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorOnVar.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorOnVar.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorOnVar_base.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorOnVar_base.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention_base.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention_base.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention_complexDispatcher.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention_complexDispatcher.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorOnVar.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorOnVar.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorOnVar_base.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorOnVar_base.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention_base.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention_base.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention_complexDispatcher.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention_complexDispatcher.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/privateMember.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/privateMember.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/qualifiedCalleeExpressionOfImplicitInvoke.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/qualifiedCalleeExpressionOfImplicitInvoke.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastExplicitDispatchReceiver.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastExplicitDispatchReceiver.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastExplicitExtensionReceiver.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastExplicitExtensionReceiver.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastImplicitDispatchReceiver.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastImplicitDispatchReceiver.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastImplicitExtensionReceiver.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastImplicitExtensionReceiver.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithInvokeFunctionCall_dispatchReceiver.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithInvokeFunctionCall_dispatchReceiver.txt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithInvokeFunctionCall_extensionReceiver.kt create mode 100644 analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithInvokeFunctionCall_extensionReceiver.txt diff --git a/analysis/analysis-api-fe10/tests/org/jetbrains/kotlin/analysis/api/descriptors/test/components/callResolver/KtFe10ResolveCallTestGenerated.java b/analysis/analysis-api-fe10/tests/org/jetbrains/kotlin/analysis/api/descriptors/test/components/callResolver/KtFe10ResolveCallTestGenerated.java index 891d4355905..65720b7fe9c 100644 --- a/analysis/analysis-api-fe10/tests/org/jetbrains/kotlin/analysis/api/descriptors/test/components/callResolver/KtFe10ResolveCallTestGenerated.java +++ b/analysis/analysis-api-fe10/tests/org/jetbrains/kotlin/analysis/api/descriptors/test/components/callResolver/KtFe10ResolveCallTestGenerated.java @@ -162,6 +162,102 @@ public class KtFe10ResolveCallTestGenerated extends AbstractKtFe10ResolveCallTes 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_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 { @@ -192,6 +288,24 @@ public class KtFe10ResolveCallTestGenerated extends AbstractKtFe10ResolveCallTes 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 { @@ -240,6 +354,18 @@ public class KtFe10ResolveCallTestGenerated extends AbstractKtFe10ResolveCallTes 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 { @@ -252,6 +378,18 @@ public class KtFe10ResolveCallTestGenerated extends AbstractKtFe10ResolveCallTes 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 { @@ -390,6 +528,66 @@ public class KtFe10ResolveCallTestGenerated extends AbstractKtFe10ResolveCallTes 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("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("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 { @@ -408,6 +606,18 @@ public class KtFe10ResolveCallTestGenerated extends AbstractKtFe10ResolveCallTes runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/simpleCallWithNonMatchingArgs.kt"); } + @Test + @TestMetadata("smartCastExplicitReceiver.kt") + public void testSmartCastExplicitReceiver() throws Exception { + runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastExplicitReceiver.kt"); + } + + @Test + @TestMetadata("smartCastImplicitReceiver.kt") + public void testSmartCastImplicitReceiver() throws Exception { + runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastImplicitReceiver.kt"); + } + @Test @TestMetadata("unresolvedSuperReference.kt") public void testUnresolvedSuperReference() throws Exception { @@ -468,6 +678,18 @@ public class KtFe10ResolveCallTestGenerated extends AbstractKtFe10ResolveCallTes 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 { diff --git a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KtFirAnalysisSessionComponent.kt b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KtFirAnalysisSessionComponent.kt index d4ce5965c01..30f4989f32a 100644 --- a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KtFirAnalysisSessionComponent.kt +++ b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KtFirAnalysisSessionComponent.kt @@ -12,17 +12,22 @@ import org.jetbrains.kotlin.analysis.api.KtTypeArgumentWithVariance import org.jetbrains.kotlin.analysis.api.diagnostics.KtDiagnosticWithPsi import org.jetbrains.kotlin.analysis.api.fir.KtFirAnalysisSession import org.jetbrains.kotlin.analysis.api.fir.diagnostics.KT_DIAGNOSTIC_CONVERTER +import org.jetbrains.kotlin.analysis.api.fir.types.KtFirGenericSubstitutor +import org.jetbrains.kotlin.analysis.api.fir.types.KtFirMapBackedSubstitutor import org.jetbrains.kotlin.analysis.api.fir.types.KtFirType import org.jetbrains.kotlin.analysis.api.types.KtSubstitutor import org.jetbrains.kotlin.analysis.api.types.KtType -import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.diagnostics.KtDiagnostic import org.jetbrains.kotlin.diagnostics.KtPsiDiagnostic +import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.analysis.diagnostics.toFirDiagnostics import org.jetbrains.kotlin.fir.diagnostics.ConeDiagnostic -import org.jetbrains.kotlin.fir.expressions.FirQualifiedAccessExpression +import org.jetbrains.kotlin.fir.expressions.FirQualifiedAccess import org.jetbrains.kotlin.fir.references.FirErrorNamedReference import org.jetbrains.kotlin.fir.references.FirResolvedNamedReference +import org.jetbrains.kotlin.fir.resolve.substitution.ChainedSubstitutor +import org.jetbrains.kotlin.fir.resolve.substitution.ConeSubstitutor +import org.jetbrains.kotlin.fir.resolve.substitution.ConeSubstitutorByMap import org.jetbrains.kotlin.fir.resolve.substitution.substitutorByMap import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol @@ -77,24 +82,40 @@ internal interface KtFirAnalysisSessionComponent { ) } - fun FirQualifiedAccessExpression.createSubstitutorFromTypeArguments(): KtSubstitutor? { + fun FirQualifiedAccess.createSubstitutorFromTypeArguments(): KtSubstitutor? { + return createConeSubstitutorFromTypeArguments()?.toKtSubstitutor() + } + + fun FirQualifiedAccess.createSubstitutorFromTypeArguments(callableSymbol: FirCallableSymbol<*>): KtSubstitutor { + return createConeSubstitutorFromTypeArguments(callableSymbol).toKtSubstitutor() + } + + fun FirQualifiedAccess.createConeSubstitutorFromTypeArguments(): ConeSubstitutor? { val symbol = when (val calleeReference = calleeReference) { is FirResolvedNamedReference -> calleeReference.resolvedSymbol as? FirCallableSymbol<*> is FirErrorNamedReference -> calleeReference.candidateSymbol as? FirCallableSymbol<*> else -> null } ?: return null - return createSubstitutorFromTypeArguments(symbol) + return createConeSubstitutorFromTypeArguments(symbol) } - fun FirQualifiedAccessExpression.createSubstitutorFromTypeArguments(functionSymbol: FirCallableSymbol<*>): KtSubstitutor { + fun FirQualifiedAccess.createConeSubstitutorFromTypeArguments(callableSymbol: FirCallableSymbol<*>): ConeSubstitutor { val typeArgumentMap = mutableMapOf() for (i in typeArguments.indices) { val type = typeArguments[i].safeAs()?.typeRef?.coneType if (type != null) { - typeArgumentMap[functionSymbol.typeParameterSymbols[i]] = type + typeArgumentMap[callableSymbol.typeParameterSymbols[i]] = type } } val coneSubstitutor = substitutorByMap(typeArgumentMap, rootModuleSession) - return firSymbolBuilder.typeBuilder.buildSubstitutor(coneSubstitutor) + return coneSubstitutor + } + + fun ConeSubstitutor.toKtSubstitutor(): KtSubstitutor { + return when (this) { + ConeSubstitutor.Empty -> KtSubstitutor.Empty(analysisSession.token) + is ConeSubstitutorByMap -> KtFirMapBackedSubstitutor(this, analysisSession.firSymbolBuilder, analysisSession.token) + else -> KtFirGenericSubstitutor(this, analysisSession.firSymbolBuilder, analysisSession.token) + } } } diff --git a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KtFirCallResolver.kt b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KtFirCallResolver.kt index e9b81d6cb3f..df03d86cd7c 100644 --- a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KtFirCallResolver.kt +++ b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KtFirCallResolver.kt @@ -5,167 +5,664 @@ package org.jetbrains.kotlin.analysis.api.fir.components -import org.jetbrains.kotlin.KtSourceElement -import org.jetbrains.kotlin.analysis.api.KtAnalysisSession import org.jetbrains.kotlin.analysis.api.calls.* import org.jetbrains.kotlin.analysis.api.diagnostics.KtNonBoundToPsiErrorDiagnostic import org.jetbrains.kotlin.analysis.api.fir.KtFirAnalysisSession -import org.jetbrains.kotlin.analysis.api.fir.buildSymbol -import org.jetbrains.kotlin.analysis.api.fir.getCandidateSymbols -import org.jetbrains.kotlin.analysis.api.fir.isImplicitFunctionCall import org.jetbrains.kotlin.analysis.api.fir.symbols.KtFirArrayOfSymbolProvider.arrayOf import org.jetbrains.kotlin.analysis.api.fir.symbols.KtFirArrayOfSymbolProvider.arrayOfSymbol import org.jetbrains.kotlin.analysis.api.fir.symbols.KtFirArrayOfSymbolProvider.arrayTypeToArrayOfCall import org.jetbrains.kotlin.analysis.api.fir.symbols.KtFirFunctionSymbol +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.symbols.* -import org.jetbrains.kotlin.analysis.api.symbols.markers.KtSymbolWithMembers import org.jetbrains.kotlin.analysis.api.tokens.ValidityToken import org.jetbrains.kotlin.analysis.api.types.KtSubstitutor import org.jetbrains.kotlin.analysis.api.withValidityAssertion import org.jetbrains.kotlin.analysis.low.level.api.fir.api.getOrBuildFir import org.jetbrains.kotlin.diagnostics.KtDiagnostic -import org.jetbrains.kotlin.fir.declarations.FirConstructor -import org.jetbrains.kotlin.fir.declarations.FirProperty +import org.jetbrains.kotlin.fir.FirElement +import org.jetbrains.kotlin.fir.analysis.checkers.toRegularClassSymbol +import org.jetbrains.kotlin.fir.declarations.FirValueParameter import org.jetbrains.kotlin.fir.expressions.* +import org.jetbrains.kotlin.fir.psi import org.jetbrains.kotlin.fir.realPsi import org.jetbrains.kotlin.fir.references.FirErrorNamedReference -import org.jetbrains.kotlin.fir.references.FirReference +import org.jetbrains.kotlin.fir.references.FirNamedReference import org.jetbrains.kotlin.fir.references.FirResolvedNamedReference import org.jetbrains.kotlin.fir.references.FirSuperReference -import org.jetbrains.kotlin.fir.references.impl.FirSimpleNamedReference -import org.jetbrains.kotlin.fir.resolve.calls.FirErrorReferenceWithCandidate +import org.jetbrains.kotlin.fir.resolve.ScopeSession +import org.jetbrains.kotlin.fir.resolve.calls.AbstractCandidate +import org.jetbrains.kotlin.fir.resolve.diagnostics.ConeDiagnosticWithCandidates +import org.jetbrains.kotlin.fir.resolve.diagnostics.ConeHiddenCandidateError +import org.jetbrains.kotlin.fir.resolve.fullyExpandedType import org.jetbrains.kotlin.fir.resolve.substitution.substitutorByMap -import org.jetbrains.kotlin.fir.symbols.impl.FirNamedFunctionSymbol -import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol +import org.jetbrains.kotlin.fir.scopes.ProcessorAction +import org.jetbrains.kotlin.fir.scopes.impl.declaredMemberScope +import org.jetbrains.kotlin.fir.scopes.processOverriddenFunctions +import org.jetbrains.kotlin.fir.scopes.unsubstitutedScope +import org.jetbrains.kotlin.fir.symbols.SymbolInternals +import org.jetbrains.kotlin.fir.symbols.impl.* import org.jetbrains.kotlin.fir.types.* -import org.jetbrains.kotlin.idea.references.FirReferenceResolveHelper -import org.jetbrains.kotlin.idea.references.readWriteAccessWithFullExpressionWithPossibleResolve +import org.jetbrains.kotlin.lexer.KtTokens import org.jetbrains.kotlin.psi.* -import org.jetbrains.kotlin.psi.psiUtil.findAssignment +import org.jetbrains.kotlin.psi.KtPsiUtil.deparenthesize +import org.jetbrains.kotlin.toKtPsiSourceElement +import org.jetbrains.kotlin.util.OperatorNameConventions +import org.jetbrains.kotlin.util.OperatorNameConventions.EQUALS +import org.jetbrains.kotlin.utils.addIfNotNull import org.jetbrains.kotlin.utils.addToStdlib.safeAs -import java.util.concurrent.ConcurrentHashMap internal class KtFirCallResolver( override val analysisSession: KtFirAnalysisSession, override val token: ValidityToken, ) : AbstractKtCallResolver(), KtFirAnalysisSessionComponent { private val diagnosticCache = mutableListOf() - private val cache: ConcurrentHashMap = ConcurrentHashMap() - override fun resolveAccessorCall(call: KtSimpleNameExpression): KtCall? = withValidityAssertion { - when (val fir = call.getOrBuildFir(firResolveState)) { - is FirResolvedNamedReference -> { - val propertySymbol = fir.resolvedSymbol as? FirPropertySymbol ?: return null + private val equalsSymbolInAny: FirNamedFunctionSymbol by lazy(LazyThreadSafetyMode.PUBLICATION) { + val session = analysisSession.rootModuleSession + val scope = session.declaredMemberScope(session.builtinTypes.anyType.toRegularClassSymbol(session)!!) + lateinit var result: FirNamedFunctionSymbol + scope.processFunctionsByName(EQUALS) { + result = it + } + result + } - @Suppress("DEPRECATION") - val access = - call.readWriteAccessWithFullExpressionWithPossibleResolve(readWriteAccessWithFullExpressionByResolve = { null }).first + override fun resolveCall(psi: KtElement): KtCallInfo? = withValidityAssertion { + if (psi is KtBinaryExpression && psi.operationToken in nonCallBinaryOperator) return null + val containingCallExpressionForCalleeExpression = psi.getContainingCallExpressionForCalleeExpression() + val containingBinaryExpressionForLhs = psi.getContainingBinaryExpressionForIncompleteLhs() + val containingUnaryExpressionForIncOrDec = psi.getContainingUnaryIncOrDecExpression() + val psiToResolve = containingCallExpressionForCalleeExpression + ?: psi.getContainingDotQualifiedExpressionForSelectorExpression() + ?: containingBinaryExpressionForLhs + ?: containingUnaryExpressionForIncOrDec + ?: psi + val fir = psiToResolve.getOrBuildFir(analysisSession.firResolveState) ?: return null + fir.toKtCallInfo( + psiToResolve, + resolveCalleeExpressionOfFunctionCall = psiToResolve == containingCallExpressionForCalleeExpression, + resolveFragmentOfCall = psiToResolve == containingBinaryExpressionForLhs || psiToResolve == containingUnaryExpressionForIncOrDec + ) + } - val setterValue = findAssignment(call)?.right - val accessor = when { - access.isWrite -> propertySymbol.setterSymbol?.fir - access.isRead -> propertySymbol.getterSymbol?.fir + private fun FirElement.toKtCallInfo( + psi: KtElement, + resolveCalleeExpressionOfFunctionCall: Boolean, + resolveFragmentOfCall: Boolean, + ): KtCallInfo? { + if (this is FirCheckNotNullCall) + return KtSuccessCallInfo(KtCheckNotNullCall(token, argumentList.arguments.first().psi as KtExpression)) + if (resolveCalleeExpressionOfFunctionCall && this is FirImplicitInvokeCall) { + // For implicit invoke, we resolve the calleeExpression of the CallExpression to the call that creates the receiver of this + // implicit invoke call. For example, + // ``` + // fun test(f: () -> Unit) { + // f() // calleeExpression `f` resolves to the local variable access, while `f()` resolves to the implicit `invoke` call. + // // This way `f` is also the explicit receiver of this implicit `invoke` call + // } + // ``` + return explicitReceiver?.toKtCallInfo( + psi, + resolveCalleeExpressionOfFunctionCall = false, + resolveFragmentOfCall = resolveFragmentOfCall + ) + } + return when (this) { + is FirResolvable -> { + when (val calleeReference = calleeReference) { + is FirResolvedNamedReference -> { + val call = createKtCall(psi, this, null, resolveFragmentOfCall) + ?: error("expect `createKtCall` to succeed for resolvable case") + KtSuccessCallInfo(call) + } + is FirErrorNamedReference -> { + val diagnostic = calleeReference.diagnostic + val ktDiagnostic = (source?.let { diagnostic.asKtDiagnostic(it, psi.toKtPsiSourceElement(), diagnosticCache) } + ?: KtNonBoundToPsiErrorDiagnostic(factoryName = null, diagnostic.reason, token)) + + if (diagnostic is ConeHiddenCandidateError) + return KtErrorCallInfo(emptyList(), ktDiagnostic, token) + + val candidateCalls = mutableListOf() + if (diagnostic is ConeDiagnosticWithCandidates) { + diagnostic.candidates.mapNotNullTo(candidateCalls) { + createKtCall(psi, this@toKtCallInfo, it, resolveFragmentOfCall) + } + } else { + candidateCalls.addIfNotNull(createKtCall(psi, this, null, resolveFragmentOfCall)) + } + KtErrorCallInfo(candidateCalls, ktDiagnostic, token) + } + // Unresolved delegated constructor call is untransformed and end up as an `FirSuperReference` + is FirSuperReference -> { + val delegatedConstructorCall = this as? FirDelegatedConstructorCall ?: return null + val errorTypeRef = delegatedConstructorCall.constructedTypeRef as? FirErrorTypeRef ?: return null + val psiSource = psi.toKtPsiSourceElement() + val ktDiagnostic = + errorTypeRef.diagnostic.asKtDiagnostic(source ?: psiSource, psiSource, diagnosticCache) ?: return null + KtErrorCallInfo(emptyList(), ktDiagnostic, token) + } else -> null - } ?: return null - val accessorSymbol = analysisSession.firSymbolBuilder.functionLikeBuilder.buildFunctionLikeSymbol(accessor) - val target = - if (!access.isWrite || setterValue != null) - KtSuccessCallTarget(accessorSymbol, token) - else // access.isWrite && setterValue == null - KtErrorCallTarget( - listOf(accessorSymbol), - KtNonBoundToPsiErrorDiagnostic(factoryName = null, "Setter value is missing", token), - token - ) - val ktArgumentMapping = LinkedHashMap() - if (access.isWrite && setterValue != null) { - val setterParameterSymbol = accessor.valueParameters.single().buildSymbol(firSymbolBuilder) as KtValueParameterSymbol - ktArgumentMapping[setterValue] = setterParameterSymbol } - return KtFunctionCall(ktArgumentMapping, target, KtSubstitutor.Empty(token), token) + } + is FirArrayOfCall -> toKtCallInfo() + is FirComparisonExpression -> compareToCall.toKtCallInfo( + psi, + resolveCalleeExpressionOfFunctionCall, + resolveFragmentOfCall + ) + // FIR does not resolve to a symbol for equality calls. + is FirEqualityOperatorCall -> toKtCallInfo(psi) + is FirSafeCallExpression -> regularQualifiedAccess.toKtCallInfo( + psi, + resolveCalleeExpressionOfFunctionCall, + resolveFragmentOfCall + ) + else -> null + } + } + + /** + * When resolving the calleeExpression of a `KtCallExpression`, we resolve the entire `KtCallExpression` instead. This way, the + * corresponding FIR element is the `FirFunctionCall`, etc. Implicit invoke is then specially handled after obtaining the + * `FirImplicitInvokeCall`. + * + * Note that, if the calleeExpression is already a KtCallExpression, then we don't do this because such a callExpression can be properly + * resolved to the desired FIR element. That is, cases like `getHighLevelFunction()()` just works, where the both `KtCallExpression` + * resolve to the desired FIR element. + */ + private fun KtElement.getContainingCallExpressionForCalleeExpression(): KtCallExpression? { + if (this !is KtExpression) return null + val calleeExpression = deparenthesize(this) ?: return null + if (calleeExpression is KtCallExpression) return null + val callExpression = parentOfType() ?: return null + if (deparenthesize(callExpression.calleeExpression) != calleeExpression) return null + return callExpression + } + + /** + * For `=` and compound access like `+=`, `-=`, `*=`, `/=`, `%=`, the LHS of the binary expression is not a complete call. Hence we + * find the containing binary expression and resolve that instead. + * + * However, if, say, `+=` resolves to `plusAssign`, then the LHS is self-contained. In this case we do not return the containing binary + * expression so that the FIR element corresponding to the LHS is used directly. + */ + private fun KtElement.getContainingBinaryExpressionForIncompleteLhs(): KtBinaryExpression? { + if (this !is KtExpression) return null + val lhs = deparenthesize(this) + val binaryExpression = parentOfType() ?: return null + if (deparenthesize(binaryExpression.left) != lhs || binaryExpression.operationToken !in KtTokens.ALL_ASSIGNMENTS) return null + val firBinaryExpression = binaryExpression.getOrBuildFir(analysisSession.firResolveState) + if (firBinaryExpression is FirFunctionCall) { + if (firBinaryExpression.origin == FirFunctionCallOrigin.Operator && + firBinaryExpression.calleeReference.name in OperatorNameConventions.ASSIGNMENT_OPERATIONS + ) { + return null + } + } + return binaryExpression + } + + /** + * For prefix and postfix `++` and `--`, the idea is the same because FIR represents it as several operations. For example, for `i++`, + * if the input PSI is `i`, we instead resolve `i++` and extract the read part of this access for `i`. + */ + private fun KtElement.getContainingUnaryIncOrDecExpression(): KtUnaryExpression? { + if (this !is KtExpression) return null + val baseExpression = deparenthesize(this) + val unaryExpression = parentOfType() ?: return null + if (deparenthesize(unaryExpression.baseExpression) != baseExpression || + unaryExpression.operationToken !in KtTokens.INCREMENT_AND_DECREMENT + ) return null + return unaryExpression + } + + /** + * When resolving selector expression of a [KtDotQualifiedExpression], we instead resolve the containing qualified expression. This way + * the corresponding FIR element is the `FirFunctionCall` or `FirPropertyAccessExpression`, etc. + */ + private fun KtElement.getContainingDotQualifiedExpressionForSelectorExpression(): KtQualifiedExpression? { + val parent = parent + if (parent is KtDotQualifiedExpression && parent.selectorExpression == this) return parent + if (parent is KtSafeQualifiedExpression && parent.selectorExpression == this) return parent + return null + } + + private fun createKtCall( + psi: KtElement, + fir: FirResolvable, + candidate: AbstractCandidate?, + resolveFragmentOfCall: Boolean + ): KtCall? { + val targetSymbol = candidate?.symbol + ?: (fir.calleeReference as? FirResolvedNamedReference)?.resolvedSymbol + ?: (fir.calleeReference as? FirNamedReference)?.candidateSymbol + ?: return null + if (targetSymbol !is FirCallableSymbol<*>) return null + if (targetSymbol is FirErrorFunctionSymbol || targetSymbol is FirErrorPropertySymbol) return null + val unsbustitutedKtSignature = targetSymbol.toKtSignature() + + handleCompoundAccessCall(psi, fir, resolveFragmentOfCall)?.let { return it } + + var firstArgIsExtensionReceiver = false + + val partiallyAppliedSymbol = if (candidate != null) { + // TODO: Ideally, we should get the substitutor from the candidate. But it seems there is no way to get the substitutor from the + // candidate, `Candidate.substitutor` is not complete. maybe we can carry over the final substitutor if it's available from + // body resolve phase? + val substitutor = + (fir as? FirQualifiedAccess)?.createConeSubstitutorFromTypeArguments()?.toKtSubstitutor() ?: KtSubstitutor.Empty(token) + KtPartiallyAppliedSymbol( + unsbustitutedKtSignature.substitute(substitutor), + candidate.dispatchReceiverValue?.receiverExpression?.toKtReceiverValue(), + candidate.extensionReceiverValue?.receiverExpression?.toKtReceiverValue(), + ) + } else if (fir is FirQualifiedAccess) { + val dispatchReceiver: KtReceiverValue? + val extensionReceiver: KtReceiverValue? + if (fir is FirImplicitInvokeCall) { + val explicitReceiverPsi = when (psi) { + is KtQualifiedExpression -> (psi.selectorExpression as KtCallExpression).calleeExpression + is KtCallExpression -> psi.calleeExpression + else -> error("unexpected PSI $psi for FirImplicitInvokeCall") + } ?: error("missing calleeExpression in PSI $psi for FirImplicitInvokeCall") + // For implicit invoke, the explicit receiver is always set in FIR and this receiver is the variable or property that has + // the `invoke` member function. In this case, we use the `calleeExpression` in the `KtCallExpression` as the PSI + // representation of this receiver. Caller can then use this PSI for further call resolution, which is implemented by the + // parameter `resolveCalleeExpressionOfFunctionCall` in `toKtCallInfo`. + val explicitReceiver = KtExplicitReceiverValue(explicitReceiverPsi, false, token) + + // Specially handle @ExtensionFunctionType + if (fir.dispatchReceiver.typeRef.coneTypeSafe()?.isExtensionFunctionType == true) { + firstArgIsExtensionReceiver = true + } + + if (fir.explicitReceiver == fir.dispatchReceiver) { + dispatchReceiver = explicitReceiver + if (firstArgIsExtensionReceiver) { + extensionReceiver = fir.arguments.first().toKtReceiverValue() + } else { + extensionReceiver = fir.extensionReceiver.toKtReceiverValue() + } + } else { + dispatchReceiver = fir.dispatchReceiver.toKtReceiverValue() + extensionReceiver = explicitReceiver + } + } else { + dispatchReceiver = fir.dispatchReceiver.toKtReceiverValue() + extensionReceiver = fir.extensionReceiver.toKtReceiverValue() + } + val substitutor = fir.createConeSubstitutorFromTypeArguments() ?: return null + KtPartiallyAppliedSymbol( + unsbustitutedKtSignature.substitute(substitutor.toKtSubstitutor()), + dispatchReceiver, + extensionReceiver, + ) + } else { + KtPartiallyAppliedSymbol(unsbustitutedKtSignature, null, null) + } + + return when (fir) { + is FirAnnotationCall -> { + if (unsbustitutedKtSignature.symbol !is KtConstructorSymbol) return null + @Suppress("UNCHECKED_CAST") // safe because of the above check on targetKtSymbol + KtAnnotationCall( + partiallyAppliedSymbol as KtPartiallyAppliedFunctionSymbol, + fir.createArgumentMapping(partiallyAppliedSymbol.signature as KtFunctionLikeSignature<*>) + ) + } + is FirDelegatedConstructorCall -> { + if (unsbustitutedKtSignature.symbol !is KtConstructorSymbol) return null + @Suppress("UNCHECKED_CAST") // safe because of the above check on targetKtSymbol + KtDelegatedConstructorCall( + partiallyAppliedSymbol as KtPartiallyAppliedFunctionSymbol, + if (fir.isThis) KtDelegatedConstructorCall.Kind.THIS_CALL else KtDelegatedConstructorCall.Kind.SUPER_CALL, + fir.createArgumentMapping(partiallyAppliedSymbol.signature as KtFunctionLikeSignature<*>) + ) + } + is FirVariableAssignment -> { + if (unsbustitutedKtSignature.symbol !is KtVariableLikeSymbol) return null + val rhs = fir.rValue.psi as? KtExpression + @Suppress("UNCHECKED_CAST") // safe because of the above check on targetKtSymbol + KtSimpleVariableAccessCall( + partiallyAppliedSymbol as KtPartiallyAppliedVariableSymbol, + KtSimpleVariableAccess.Write(rhs) + ) } is FirPropertyAccessExpression -> { - KtFunctionCall(LinkedHashMap(), fir.calleeReference.createCallTarget() ?: return null, KtSubstitutor.Empty(token), token) + if (unsbustitutedKtSignature.symbol !is KtVariableLikeSymbol) return null + @Suppress("UNCHECKED_CAST") // safe because of the above check on targetKtSymbol + KtSimpleVariableAccessCall( + partiallyAppliedSymbol as KtPartiallyAppliedVariableSymbol, + KtSimpleVariableAccess.Read + ) } - else -> return null + is FirFunctionCall -> { + if (unsbustitutedKtSignature.symbol !is KtFunctionLikeSymbol) return null + val argumentMapping = + if (firstArgIsExtensionReceiver) { + fir.argumentMapping?.entries?.drop(1) + } else { + fir.argumentMapping?.entries + } + @Suppress("UNCHECKED_CAST") // safe because of the above check on targetKtSymbol + KtSimpleFunctionCall( + partiallyAppliedSymbol as KtPartiallyAppliedFunctionSymbol, + argumentMapping + ?.createArgumentMapping(partiallyAppliedSymbol.signature as KtFunctionLikeSignature<*>) + ?: LinkedHashMap(), + fir is FirImplicitInvokeCall + ) + } + is FirExpressionWithSmartcast -> createKtCall(psi, fir.originalExpression, candidate, resolveFragmentOfCall) + else -> null } } - override fun resolveCall(call: KtBinaryExpression): KtCall? = withValidityAssertion { - cache.computeIfAbsent(call) { - when (val fir = call.getOrBuildFir(firResolveState)) { - is FirFunctionCall -> resolveCall(fir) - is FirComparisonExpression -> resolveCall(fir.compareToCall) - is FirEqualityOperatorCall -> null // TODO - else -> null - } - } - } + private fun handleCompoundAccessCall(psi: KtElement, fir: FirResolvable, resolveFragmentOfCall: Boolean): KtCall? { + if (psi is KtBinaryExpression && psi.operationToken in KtTokens.AUGMENTED_ASSIGNMENTS) { + val rightOperandPsi = deparenthesize(psi.right) ?: return null + val leftOperandPsi = deparenthesize(psi.left) ?: return null + val compoundAssignKind = psi.getCompoundAssignKind() - override fun resolveCall(call: KtUnaryExpression): KtCall? = withValidityAssertion { - cache.computeIfAbsent(call) { - when (val fir = call.getOrBuildFir(firResolveState)) { - is FirFunctionCall -> resolveCall(fir) - is FirBlock -> { - // Desugared increment or decrement block. See [BaseFirBuilder#generateIncrementOrDecrementBlock] - // There would be corresponding inc()/dec() call that is assigned back to a temp variable. - val prefix = fir.statements.filterIsInstance().find { it.rValue is FirFunctionCall } - (prefix?.rValue as? FirFunctionCall)?.let { resolveCall(it) } + // handle compound assignment with array access convention + if (fir is FirFunctionCall && fir.calleeReference.name == OperatorNameConventions.SET && leftOperandPsi is KtArrayAccessExpression) { + val (operationPartiallyAppliedSymbol, getPartiallyAppliedSymbol, setPartiallyAppliedSymbol) = + getOperationPartiallyAppliedSymbolsForCompoundArrayAssignment(fir, leftOperandPsi) ?: return null + + val getAccessArgumentMapping = LinkedHashMap>().apply { + putAll(leftOperandPsi.indexExpressions.zip(getPartiallyAppliedSymbol.signature.valueParameters)) } - is FirCheckNotNullCall -> null // TODO - else -> null + + return if (resolveFragmentOfCall) { + KtSimpleFunctionCall(getPartiallyAppliedSymbol, getAccessArgumentMapping, false) + } else { + KtCompoundArrayAccessCall( + KtCompoundAccess.CompoundAssign(operationPartiallyAppliedSymbol, compoundAssignKind, rightOperandPsi), + leftOperandPsi.indexExpressions, + getPartiallyAppliedSymbol, + setPartiallyAppliedSymbol + ) + } + } + + // handle compound assignment with variable + if (fir is FirVariableAssignment && (leftOperandPsi is KtDotQualifiedExpression || + leftOperandPsi is KtNameReferenceExpression) + ) { + val variablePartiallyAppliedSymbol = fir.toPartiallyAppliedSymbol() ?: return null + val operationPartiallyAppliedSymbol = + getOperationPartiallyAppliedSymbolsForCompoundVariableAccess(fir, leftOperandPsi) ?: return null + return if (resolveFragmentOfCall) { + KtSimpleVariableAccessCall(variablePartiallyAppliedSymbol, KtSimpleVariableAccess.Read) + } else { + KtCompoundVariableAccessCall( + variablePartiallyAppliedSymbol, + KtCompoundAccess.CompoundAssign(operationPartiallyAppliedSymbol, compoundAssignKind, rightOperandPsi), + ) + } + } + } else if (psi is KtUnaryExpression && psi.operationToken in KtTokens.INCREMENT_AND_DECREMENT) { + val incDecPrecedence = when (psi) { + is KtPostfixExpression -> KtCompoundAccess.IncOrDecOperation.Precedence.POSTFIX + else -> KtCompoundAccess.IncOrDecOperation.Precedence.PREFIX + } + val incOrDecOperationKind = psi.getInOrDecOperationKind() + val baseExpression = deparenthesize(psi.baseExpression) + + // handle inc/dec/ with array access convention + if (fir is FirFunctionCall && fir.calleeReference.name == OperatorNameConventions.SET && baseExpression is KtArrayAccessExpression) { + val (operationPartiallyAppliedSymbol, getPartiallyAppliedSymbol, setPartiallyAppliedSymbol) = + getOperationPartiallyAppliedSymbolsForIncOrDecOperation(fir, baseExpression, incDecPrecedence) ?: return null + + val getAccessArgumentMapping = LinkedHashMap>().apply { + putAll(baseExpression.indexExpressions.zip(getPartiallyAppliedSymbol.signature.valueParameters)) + } + return if (resolveFragmentOfCall) { + KtSimpleFunctionCall(getPartiallyAppliedSymbol, getAccessArgumentMapping, false) + } else { + KtCompoundArrayAccessCall( + KtCompoundAccess.IncOrDecOperation(operationPartiallyAppliedSymbol, incOrDecOperationKind, incDecPrecedence), + baseExpression.indexExpressions, + getPartiallyAppliedSymbol, + setPartiallyAppliedSymbol + ) + } + } + + // handle inc/dec/ with variable + if (fir is FirVariableAssignment && (baseExpression is KtDotQualifiedExpression || + baseExpression is KtNameReferenceExpression) + ) { + val variablePartiallyAppliedSymbol = fir.toPartiallyAppliedSymbol() ?: return null + val operationPartiallyAppliedSymbol = + getOperationPartiallyAppliedSymbolsForCompoundVariableAccess(fir, baseExpression) ?: return null + return if (resolveFragmentOfCall) { + KtSimpleVariableAccessCall(variablePartiallyAppliedSymbol, KtSimpleVariableAccess.Read) + } else { + KtCompoundVariableAccessCall( + variablePartiallyAppliedSymbol, + KtCompoundAccess.IncOrDecOperation(operationPartiallyAppliedSymbol, incOrDecOperationKind, incDecPrecedence), + ) + } + } + } + return null + } + + private data class CompoundArrayAccessPartiallyAppliedSymbols( + val operationPartiallyAppliedSymbol: KtPartiallyAppliedFunctionSymbol, + val getPartiallyAppliedSymbol: KtPartiallyAppliedFunctionSymbol, + val setPartiallyAppliedSymbol: KtPartiallyAppliedFunctionSymbol + ) + + private fun getOperationPartiallyAppliedSymbolsForCompoundArrayAssignment( + fir: FirFunctionCall, + arrayAccessExpression: KtArrayAccessExpression + ): CompoundArrayAccessPartiallyAppliedSymbols? { + // The last argument of `set` is the new value to be set. This value should be a call to the respective `plus`, `minus`, + // `times`, `div`, or `rem` function. + val operationCall = fir.arguments.lastOrNull() as? FirFunctionCall ?: return null + + // The explicit receiver in this case is a synthetic FirFunctionCall to `get`, which does not have a corresponding PSI. So + // we use the `leftOperandPsi` as the supplement. + val operationPartiallyAppliedSymbol = operationCall.toPartiallyAppliedSymbol(arrayAccessExpression) ?: return null + + // The explicit receiver for both `get` and `set` call should be the array expression. + val getPartiallyAppliedSymbol = + (operationCall.explicitReceiver as? FirFunctionCall)?.toPartiallyAppliedSymbol(arrayAccessExpression.arrayExpression) + ?: return null + val setPartiallyAppliedSymbol = fir.toPartiallyAppliedSymbol(arrayAccessExpression.arrayExpression) ?: return null + + return CompoundArrayAccessPartiallyAppliedSymbols( + operationPartiallyAppliedSymbol, + getPartiallyAppliedSymbol, + setPartiallyAppliedSymbol + ) + } + + @OptIn(SymbolInternals::class) + private fun getOperationPartiallyAppliedSymbolsForIncOrDecOperation( + fir: FirFunctionCall, + arrayAccessExpression: KtArrayAccessExpression, + incDecPrecedence: KtCompoundAccess.IncOrDecOperation.Precedence + ): CompoundArrayAccessPartiallyAppliedSymbols? { + val lastArg = fir.arguments.lastOrNull() ?: return null + val setPartiallyAppliedSymbol = fir.toPartiallyAppliedSymbol(arrayAccessExpression.arrayExpression) ?: return null + return when (incDecPrecedence) { + KtCompoundAccess.IncOrDecOperation.Precedence.PREFIX -> { + // For prefix case, the last argument is a reference to a synthetic local variable `` storing the result. So + // we find the inc or dec operation call from the initializer of this local variable. + val operationCall = getInitializerOfReferencedLocalVariable(lastArg) ?: return null + val operationPartiallyAppliedSymbol = operationCall.toPartiallyAppliedSymbol(arrayAccessExpression) ?: return null + // The get call is the explicit receiver of this operation call + val getCall = operationCall.explicitReceiver as? FirFunctionCall ?: return null + val getPartiallyAppliedSymbol = getCall.toPartiallyAppliedSymbol(arrayAccessExpression.arrayExpression) ?: return null + CompoundArrayAccessPartiallyAppliedSymbols( + operationPartiallyAppliedSymbol, + getPartiallyAppliedSymbol, + setPartiallyAppliedSymbol + ) + } + KtCompoundAccess.IncOrDecOperation.Precedence.POSTFIX -> { + // For postfix case, the last argument is the operation call invoked on a synthetic local variable ``. This local + // variable is initialized by calling the `get` function. + val operationCall = lastArg as? FirFunctionCall ?: return null + val operationPartiallyAppliedSymbol = operationCall.toPartiallyAppliedSymbol(arrayAccessExpression) ?: return null + val receiverOfOperationCall = operationCall.explicitReceiver ?: return null + val getCall = getInitializerOfReferencedLocalVariable(receiverOfOperationCall) + val getPartiallyAppliedSymbol = getCall?.toPartiallyAppliedSymbol(arrayAccessExpression.arrayExpression) ?: return null + CompoundArrayAccessPartiallyAppliedSymbols( + operationPartiallyAppliedSymbol, + getPartiallyAppliedSymbol, + setPartiallyAppliedSymbol + ) } } } - override fun resolveCall(call: KtCallElement): KtCall? = withValidityAssertion { - cache.computeIfAbsent(call) { - when (val fir = call.getOrBuildFir(firResolveState)) { - is FirArrayOfCall -> resolveArrayOfCall(fir) - is FirFunctionCall -> resolveCall(fir) - is FirAnnotationCall -> fir.asAnnotationCall() - is FirDelegatedConstructorCall -> fir.asDelegatedConstructorCall() - is FirConstructor -> fir.asDelegatedConstructorCall() - is FirSafeCallExpression -> fir.regularQualifiedAccess.safeAs()?.let { resolveCall(it) } - else -> null + @OptIn(SymbolInternals::class) + private fun getInitializerOfReferencedLocalVariable(variableReference: FirExpression): FirFunctionCall? { + val qualifiedAccess = variableReference as? FirQualifiedAccess + val resolvedNamedReference = qualifiedAccess?.calleeReference as? FirResolvedNamedReference + val unaryResult = resolvedNamedReference?.resolvedSymbol as? FirVariableSymbol<*> + return unaryResult?.fir?.initializer as? FirFunctionCall + } + + private fun getOperationPartiallyAppliedSymbolsForCompoundVariableAccess( + fir: FirVariableAssignment, + leftOperandPsi: KtExpression + ): KtPartiallyAppliedFunctionSymbol? { + // The new value is a call to the appropriate operator function. + val operationCall = fir.rValue as? FirFunctionCall ?: return null + return operationCall.toPartiallyAppliedSymbol(leftOperandPsi) + } + + private fun FirVariableAssignment.toPartiallyAppliedSymbol(): KtPartiallyAppliedVariableSymbol? { + val variableRef = calleeReference as? FirResolvedNamedReference ?: return null + val variableSymbol = variableRef.resolvedSymbol as? FirVariableSymbol<*> ?: return null + val substitutor = createConeSubstitutorFromTypeArguments() ?: return null + val ktSignature = variableSymbol.toKtSignature() + return KtPartiallyAppliedSymbol( + ktSignature.substitute(substitutor.toKtSubstitutor()), + dispatchReceiver.toKtReceiverValue(), + extensionReceiver.toKtReceiverValue(), + ) + } + + private fun FirFunctionCall.toPartiallyAppliedSymbol( + explicitReceiverPsiSupplement: KtExpression? = null + ): KtPartiallyAppliedFunctionSymbol? { + val operationSymbol = + (calleeReference as? FirResolvedNamedReference)?.resolvedSymbol as? FirNamedFunctionSymbol ?: return null + val substitutor = createConeSubstitutorFromTypeArguments() ?: return null + val dispatchReceiverValue = if (explicitReceiverPsiSupplement != null && explicitReceiver == dispatchReceiver) { + explicitReceiverPsiSupplement.toExplicitReceiverValue() + } else { + dispatchReceiver.toKtReceiverValue() + } + val extensionReceiverValue = if (explicitReceiverPsiSupplement != null && explicitReceiver == extensionReceiver) { + explicitReceiverPsiSupplement.toExplicitReceiverValue() + } else { + extensionReceiver.toKtReceiverValue() + } + val ktSignature = operationSymbol.toKtSignature() + return KtPartiallyAppliedSymbol( + ktSignature.substitute(substitutor.toKtSubstitutor()), + dispatchReceiverValue, + extensionReceiverValue, + ) + } + + @OptIn(SymbolInternals::class) + private fun FirExpression.toKtReceiverValue(): KtReceiverValue? { + val psi = psi + return when (this) { + is FirExpressionWithSmartcast -> { + val result = originalExpression.toKtReceiverValue() + if (result != null && isStable) { + KtSmartCastedReceiverValue(result, smartcastType.coneType.asKtType()) + } else { + result + } + } + is FirThisReceiverExpression -> { + if (psi == null) { + val implicitPartiallyAppliedSymbol = when (val partiallyAppliedSymbol = calleeReference.boundSymbol) { + is FirClassSymbol<*> -> partiallyAppliedSymbol.toKtSymbol() + is FirCallableSymbol<*> -> firSymbolBuilder.callableBuilder.buildExtensionReceiverSymbol(partiallyAppliedSymbol.fir) + ?: return null + else -> return null + } + KtImplicitReceiverValue(implicitPartiallyAppliedSymbol) + } else { + if (psi !is KtExpression) return null + psi.toExplicitReceiverValue() + } + } + else -> { + if (psi !is KtExpression) return null + psi.toExplicitReceiverValue() } } } - override fun resolveCall(call: KtArrayAccessExpression): KtCall? = withValidityAssertion { - cache.computeIfAbsent(call) { - when (val fir = call.getOrBuildFir(firResolveState)) { - is FirFunctionCall -> resolveCall(fir) - else -> null - } - } - } + @OptIn(SymbolInternals::class) + private fun FirCallableSymbol<*>.toKtSignature(): KtSignature = + firSymbolBuilder.callableBuilder.buildCallableSignature(fir) - private fun resolveArrayOfCall(arrayOfCall: FirArrayOfCall): KtCall? { + @OptIn(SymbolInternals::class) + private fun FirClassLikeSymbol<*>.toKtSymbol(): KtClassLikeSymbol = firSymbolBuilder.classifierBuilder.buildClassLikeSymbol(fir) + + @OptIn(SymbolInternals::class) + private fun FirNamedFunctionSymbol.toKtSignature(): KtFunctionLikeSignature = + firSymbolBuilder.functionLikeBuilder.buildFunctionSignature(fir) + + @OptIn(SymbolInternals::class) + private fun FirVariableSymbol<*>.toKtSignature(): KtVariableLikeSignature = + firSymbolBuilder.variableLikeBuilder.buildVariableLikeSignature(fir) + + @OptIn(SymbolInternals::class) + private fun FirValueParameterSymbol.toKtSymbol(): KtValueParameterSymbol = + firSymbolBuilder.variableLikeBuilder.buildValueParameterSymbol(fir) + + private fun FirArrayOfCall.toKtCallInfo(): KtCallInfo? { val arrayOfSymbol = with(analysisSession) { - val type = arrayOfCall.typeRef.coneTypeSafe() + val type = typeRef.coneTypeSafe() ?: return run { val defaultArrayOfSymbol = arrayOfSymbol(arrayOf) ?: return null - KtFunctionCall( - arrayOfCall.createArgumentMapping(defaultArrayOfSymbol), - KtErrorCallTarget( - listOf(defaultArrayOfSymbol), - KtNonBoundToPsiErrorDiagnostic(factoryName = null, "type of arrayOf call is not resolved", token), - token + val substitutor = createSubstitutorFromTypeArguments(defaultArrayOfSymbol) + KtErrorCallInfo( + listOf( + KtSimpleFunctionCall( + KtPartiallyAppliedSymbol( + defaultArrayOfSymbol.toSignature(substitutor), + null, + null, + ), + createArgumentMapping(defaultArrayOfSymbol, substitutor), + false, + ) ), - arrayOfCall.createSubstitutorFromTypeArguments(defaultArrayOfSymbol), + KtNonBoundToPsiErrorDiagnostic(factoryName = null, "type of arrayOf call is not resolved", token), token ) } val call = arrayTypeToArrayOfCall[type.lookupTag.classId] ?: arrayOf arrayOfSymbol(call) } ?: return null - return KtFunctionCall( - arrayOfCall.createArgumentMapping(arrayOfSymbol), - KtSuccessCallTarget(arrayOfSymbol, token), - arrayOfCall.createSubstitutorFromTypeArguments(arrayOfSymbol), - token + val substitutor = createSubstitutorFromTypeArguments(arrayOfSymbol) + return KtSuccessCallInfo( + KtSimpleFunctionCall( + KtPartiallyAppliedSymbol( + arrayOfSymbol.toSignature(substitutor), + null, + null, + ), + createArgumentMapping(arrayOfSymbol, substitutor), + false + ) ) } @@ -179,117 +676,90 @@ internal class KtFirCallResolver( } ?: KtSubstitutor.Empty(token) } - private fun resolveCall(firCall: FirFunctionCall): KtCall? { - val session = firResolveState.rootModuleSession - return when { - firCall.isImplicitFunctionCall() -> { - val target = with(FirReferenceResolveHelper) { - val calleeReference = ((firCall.extensionReceiver as? FirQualifiedAccessExpression) - ?: firCall.dispatchReceiver as FirQualifiedAccessExpression).calleeReference - calleeReference.toTargetSymbol(session, firSymbolBuilder).singleOrNull() - } - when (target) { - is KtVariableLikeSymbol -> firCall.createCallByVariableLikeSymbolCall(target) - null -> null - else -> firCall.asSimpleFunctionCall() + private fun FirEqualityOperatorCall.toKtCallInfo(psi: KtElement): KtCallInfo? { + val binaryExpression = deparenthesize(psi as? KtExpression) as? KtBinaryExpression ?: return null + val leftPsi = binaryExpression.left ?: return null + val rightPsi = binaryExpression.right ?: return null + return when (operation) { + FirOperation.EQ, FirOperation.NOT_EQ -> { + val equalsSymbolInAny = equalsSymbolInAny + val leftOperand = arguments.firstOrNull() ?: return null + val session = analysisSession.rootModuleSession + val classSymbol = leftOperand.typeRef.coneType.fullyExpandedType(session).toSymbol(session) as? FirClassSymbol<*> + val equalsSymbol = classSymbol?.getEqualsSymbol(equalsSymbolInAny) ?: equalsSymbolInAny + val ktSignature = equalsSymbol.toKtSignature() + KtSuccessCallInfo( + KtSimpleFunctionCall( + KtPartiallyAppliedSymbol( + ktSignature, + KtExplicitReceiverValue(leftPsi, false, token), + null + ), + LinkedHashMap>().apply { + put(rightPsi, ktSignature.valueParameters.first()) + }, + false + ) + ) + } + else -> null + } + } + + private fun FirClassSymbol<*>.getEqualsSymbol(equalsSymbolInAny: FirNamedFunctionSymbol): FirNamedFunctionSymbol { + val scope = unsubstitutedScope(analysisSession.rootModuleSession, ScopeSession(), false) + var equalsSymbol: FirNamedFunctionSymbol? = null + scope.processFunctionsByName(EQUALS) { equalsSymbolFromScope -> + if (equalsSymbol != null) return@processFunctionsByName + if (equalsSymbolFromScope == equalsSymbolInAny) { + equalsSymbol = equalsSymbolFromScope + } + scope.processOverriddenFunctions(equalsSymbolFromScope) { + if (it == equalsSymbolInAny) { + equalsSymbol = equalsSymbolFromScope + ProcessorAction.STOP + } else { + ProcessorAction.NEXT } } - else -> firCall.asSimpleFunctionCall() } + return equalsSymbol ?: equalsSymbolInAny } - private fun FirFunctionCall.createCallByVariableLikeSymbolCall(variableLikeSymbol: KtVariableLikeSymbol): KtCall? { - val (functionSymbol, target) = when (val callReference = calleeReference) { - is FirResolvedNamedReference -> { - val functionSymbol = callReference.resolvedSymbol as? FirNamedFunctionSymbol - (functionSymbol?.fir?.buildSymbol(firSymbolBuilder) as? KtFunctionSymbol)?.let { - functionSymbol to KtSuccessCallTarget(it, token) - } ?: return null - } - is FirErrorNamedReference -> { - val functionSymbol = callReference.candidateSymbol as? FirNamedFunctionSymbol - functionSymbol to callReference.createErrorCallTarget(source) - } - else -> error("Unexpected call reference ${callReference::class.simpleName}") + private fun FirCall.createArgumentMapping(signatureOfCallee: KtFunctionLikeSignature<*>): LinkedHashMap> { + return argumentMapping?.entries.createArgumentMapping(signatureOfCallee) + } + + private fun Iterable>?.createArgumentMapping( + signatureOfCallee: KtFunctionLikeSignature<*> + ): LinkedHashMap> { + val paramSignatureByName = signatureOfCallee.valueParameters.associateBy { it.symbol.name } + val ktArgumentMapping = LinkedHashMap>() + this?.forEach { (firExpression, firValueParameter) -> + val parameterSymbol = paramSignatureByName[firValueParameter.symbol.name] ?: return@forEach + mapArgumentExpressionToParameter(firExpression, parameterSymbol, ktArgumentMapping) } - val callableId = functionSymbol?.callableId ?: return null - return if (callableId in kotlinFunctionInvokeCallableIds) { - // A fake override is always created for a function type with all types substituted properly inside the dispatch receiver. Hence - // there is no need for additional substitutor. - KtFunctionalTypeVariableCall(variableLikeSymbol, createArgumentMapping(), target, KtSubstitutor.Empty(token), token) - } else { - val substitutor = createSubstitutorFromTypeArguments(functionSymbol) - KtVariableWithInvokeFunctionCall( - variableLikeSymbol, - createArgumentMapping(), - target, - substitutor, token - ) + return ktArgumentMapping + } + + private fun FirArrayOfCall.createArgumentMapping( + arrayOfCallSymbol: KtFirFunctionSymbol, + substitutor: KtSubstitutor, + ): LinkedHashMap> { + val ktArgumentMapping = LinkedHashMap>() + val parameterSymbol = arrayOfCallSymbol.firRef.withFir { + it.valueParameters.single().symbol.toKtSymbol() } - } - - private fun FirFunctionCall.asSimpleFunctionCall(): KtFunctionCall? { - val target = this.calleeReference.createCallTarget() ?: return null - return KtFunctionCall(createArgumentMapping(), target, createSubstitutorFromTypeArguments() ?: return null, token) - } - - private fun FirAnnotationCall.asAnnotationCall(): KtAnnotationCall? { - val target = calleeReference.createCallTarget() ?: return null - return KtAnnotationCall(createArgumentMapping(), target, token) - } - - private fun FirDelegatedConstructorCall.asDelegatedConstructorCall(): KtDelegatedConstructorCall? { - val target = calleeReference.createCallTarget() ?: return null - val kind = if (isSuper) KtDelegatedConstructorCallKind.SUPER_CALL else KtDelegatedConstructorCallKind.THIS_CALL - return KtDelegatedConstructorCall(createArgumentMapping(), target, kind, token) - } - - private fun FirConstructor.asDelegatedConstructorCall(): KtDelegatedConstructorCall? { - // A delegation call may not be present in the source code: - // - // class A { - // constructor(i: Int) // <--- implicit constructor delegation call (empty element after RPAR) - // } - // - // and FIR built/found from that implicit `KtConstructorDelegationCall` is `FirConstructor`, - // which may have a pointer to the delegated constructor. - return delegatedConstructor?.asDelegatedConstructorCall() - } - - private fun FirReference.createCallTarget(): KtCallTarget? { - return when (this) { - is FirSuperReference -> createCallTarget(source) - is FirResolvedNamedReference -> getKtFunctionLikeSymbol()?.let { KtSuccessCallTarget(it, token) } - is FirErrorNamedReference -> createErrorCallTarget(source) - is FirErrorReferenceWithCandidate -> createErrorCallTarget(source) - is FirSimpleNamedReference -> - null - /* error( - """ - Looks like ${this::class.simpleName} && it calle reference ${calleeReference::class.simpleName} were not resolved to BODY_RESOLVE phase, - consider resolving it containing declaration before starting resolve calls - ${this.render()} - ${(this.psi as? KtElement)?.getElementTextInContext()} - """.trimIndent() - )*/ - else -> error("Unexpected call reference ${this::class.simpleName}") - } - } - - private fun FirExpression.findSourceKtExpressionForCallArgument(): KtExpression? { - // For spread, named, and lambda arguments, the source is the KtValueArgument. - // For other arguments (including array indices), the source is the KtExpression. - return when (this) { - is FirNamedArgumentExpression, is FirSpreadArgumentExpression, is FirLambdaArgumentExpression -> - realPsi.safeAs()?.getArgumentExpression() - else -> realPsi as? KtExpression + for (firExpression in argumentList.arguments) { + mapArgumentExpressionToParameter(firExpression, parameterSymbol.toSignature(substitutor), ktArgumentMapping) } + return ktArgumentMapping } private fun mapArgumentExpressionToParameter( argumentExpression: FirExpression, - parameterSymbol: KtValueParameterSymbol, - argumentMapping: LinkedHashMap + parameterSymbol: KtVariableLikeSignature, + argumentMapping: LinkedHashMap> ) { if (argumentExpression is FirVarargArgumentsExpression) { for (varargArgument in argumentExpression.arguments) { @@ -302,67 +772,13 @@ internal class KtFirCallResolver( } } - private fun FirCall.createArgumentMapping(): LinkedHashMap { - val ktArgumentMapping = LinkedHashMap() - argumentMapping?.let { - for ((firExpression, firValueParameter) in it.entries) { - val parameterSymbol = firValueParameter.buildSymbol(firSymbolBuilder) as KtValueParameterSymbol - mapArgumentExpressionToParameter(firExpression, parameterSymbol, ktArgumentMapping) - } + private fun FirExpression.findSourceKtExpressionForCallArgument(): KtExpression? { + // For spread, named, and lambda arguments, the source is the KtValueArgument. + // For other arguments (including array indices), the source is the KtExpression. + return when (this) { + is FirNamedArgumentExpression, is FirSpreadArgumentExpression, is FirLambdaArgumentExpression -> + realPsi.safeAs()?.getArgumentExpression() + else -> realPsi as? KtExpression } - return ktArgumentMapping } - - private fun FirArrayOfCall.createArgumentMapping( - arrayOfCallSymbol: KtFirFunctionSymbol - ): LinkedHashMap { - val ktArgumentMapping = LinkedHashMap() - val parameterSymbol = arrayOfCallSymbol.firRef.withFir { - it.valueParameters.single().buildSymbol(firSymbolBuilder) as KtValueParameterSymbol - } - for (firExpression in argumentList.arguments) { - mapArgumentExpressionToParameter(firExpression, parameterSymbol, ktArgumentMapping) - } - return ktArgumentMapping - } - - private fun FirErrorNamedReference.createErrorCallTarget(qualifiedAccessSource: KtSourceElement?): KtErrorCallTarget = - KtErrorCallTarget( - getCandidateSymbols().mapNotNull { it.fir.buildSymbol(firSymbolBuilder) as? KtFunctionLikeSymbol }, - source?.let { diagnostic.asKtDiagnostic(it, qualifiedAccessSource, diagnosticCache) } - ?: KtNonBoundToPsiErrorDiagnostic(factoryName = null, diagnostic.reason, token), token) - - private fun FirErrorReferenceWithCandidate.createErrorCallTarget(qualifiedAccessSource: KtSourceElement?): KtErrorCallTarget = - KtErrorCallTarget( - getCandidateSymbols().mapNotNull { it.fir.buildSymbol(firSymbolBuilder) as? KtFunctionLikeSymbol }, - source?.let { diagnostic.asKtDiagnostic(it, qualifiedAccessSource, diagnosticCache) } - ?: KtNonBoundToPsiErrorDiagnostic(factoryName = null, diagnostic.reason, token), token) - - private fun FirResolvedNamedReference.getKtFunctionLikeSymbol(): KtFunctionLikeSymbol? { - val fir = resolvedSymbol.fir - val targetFir = if (fir is FirProperty) fir.getter else fir - return targetFir?.buildSymbol(firSymbolBuilder) as? KtFunctionLikeSymbol - } - - private fun FirSuperReference.createCallTarget(qualifiedAccessSource: KtSourceElement?): KtCallTarget? = - when (val type = superTypeRef.coneType) { - is ConeKotlinErrorType -> - KtErrorCallTarget( - (firSymbolBuilder.classifierBuilder.buildClassLikeSymbolByLookupTag(type.lookupTag) as? KtSymbolWithMembers)?.let { - analysisSession.getPrimaryConstructor(it)?.let { ctor -> listOf(ctor) } - } ?: emptyList(), - source?.let { type.diagnostic.asKtDiagnostic(it, qualifiedAccessSource, diagnosticCache) } - ?: KtNonBoundToPsiErrorDiagnostic(factoryName = null, type.diagnostic.reason, token), token) - is ConeClassLikeType -> - type.classId?.let { classId -> - (firSymbolBuilder.classifierBuilder.buildClassLikeSymbolByClassId(classId) as? KtSymbolWithMembers)?.let { - analysisSession.getPrimaryConstructor(it)?.let { ctor -> KtSuccessCallTarget(ctor, token) } - } - } - else -> - error("Unexpected type in super reference: ${type::class}") - } - - private fun KtAnalysisSession.getPrimaryConstructor(symbolWithMembers: KtSymbolWithMembers): KtConstructorSymbol? = - symbolWithMembers.getDeclaredMemberScope().getConstructors().firstOrNull { it.isPrimary } } diff --git a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/references/KtFirInvokeFunctionReference.kt b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/references/KtFirInvokeFunctionReference.kt index 570b5fda48f..e2bb226de70 100644 --- a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/references/KtFirInvokeFunctionReference.kt +++ b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/references/KtFirInvokeFunctionReference.kt @@ -7,6 +7,8 @@ package org.jetbrains.kotlin.idea.references import org.jetbrains.kotlin.analysis.api.KtAnalysisSession import org.jetbrains.kotlin.analysis.api.calls.KtSimpleFunctionCall +import org.jetbrains.kotlin.analysis.api.calls.calls +import org.jetbrains.kotlin.analysis.api.calls.symbol import org.jetbrains.kotlin.analysis.api.symbols.KtFunctionSymbol import org.jetbrains.kotlin.analysis.api.symbols.KtSymbol import org.jetbrains.kotlin.psi.KtCallExpression @@ -21,7 +23,7 @@ class KtFirInvokeFunctionReference(expression: KtCallExpression) : KtInvokeFunct return expression.resolveCall().calls.mapNotNull { call -> (call as? KtSimpleFunctionCall) ?.takeIf { it.isImplicitInvoke } - ?.boundSymbol + ?.partiallyAppliedSymbol ?.symbol ?.takeUnless { it is KtFunctionSymbol && it.isBuiltinFunctionInvoke } } diff --git a/analysis/analysis-api-fir/tests/org/jetbrains/kotlin/analysis/api/fir/components/callResolver/FirResolveCallTestGenerated.java b/analysis/analysis-api-fir/tests/org/jetbrains/kotlin/analysis/api/fir/components/callResolver/FirResolveCallTestGenerated.java index 74adedd3290..d74d2a9f346 100644 --- a/analysis/analysis-api-fir/tests/org/jetbrains/kotlin/analysis/api/fir/components/callResolver/FirResolveCallTestGenerated.java +++ b/analysis/analysis-api-fir/tests/org/jetbrains/kotlin/analysis/api/fir/components/callResolver/FirResolveCallTestGenerated.java @@ -162,6 +162,108 @@ public class FirResolveCallTestGenerated extends AbstractFirResolveCallTest { 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 { @@ -192,6 +294,24 @@ public class FirResolveCallTestGenerated extends AbstractFirResolveCallTest { 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 { @@ -240,6 +360,18 @@ public class FirResolveCallTestGenerated extends AbstractFirResolveCallTest { 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 { @@ -252,6 +384,18 @@ public class FirResolveCallTestGenerated extends AbstractFirResolveCallTest { 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 { @@ -390,6 +534,78 @@ public class FirResolveCallTestGenerated extends AbstractFirResolveCallTest { 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 { @@ -408,6 +624,30 @@ public class FirResolveCallTestGenerated extends AbstractFirResolveCallTest { 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 { @@ -468,6 +708,18 @@ public class FirResolveCallTestGenerated extends AbstractFirResolveCallTest { 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 { diff --git a/analysis/analysis-api-impl-base/src/org/jetbrains/kotlin/analysis/api/impl/base/components/AbstractKtCallResolver.kt b/analysis/analysis-api-impl-base/src/org/jetbrains/kotlin/analysis/api/impl/base/components/AbstractKtCallResolver.kt index a4cb58b2be4..a195923e2f4 100644 --- a/analysis/analysis-api-impl-base/src/org/jetbrains/kotlin/analysis/api/impl/base/components/AbstractKtCallResolver.kt +++ b/analysis/analysis-api-impl-base/src/org/jetbrains/kotlin/analysis/api/impl/base/components/AbstractKtCallResolver.kt @@ -5,18 +5,45 @@ package org.jetbrains.kotlin.analysis.api.impl.base.components +import org.jetbrains.kotlin.analysis.api.calls.KtCompoundAccess +import org.jetbrains.kotlin.analysis.api.calls.KtExplicitReceiverValue import org.jetbrains.kotlin.analysis.api.components.KtCallResolver -import org.jetbrains.kotlin.builtins.StandardNames -import org.jetbrains.kotlin.name.CallableId -import org.jetbrains.kotlin.util.OperatorNameConventions +import org.jetbrains.kotlin.analysis.api.impl.barebone.parentOfType +import org.jetbrains.kotlin.lexer.KtTokens +import org.jetbrains.kotlin.psi.* abstract class AbstractKtCallResolver : KtCallResolver() { - protected companion object { - val kotlinFunctionInvokeCallableIds = (0..23).flatMapTo(hashSetOf()) { arity -> - listOf( - CallableId(StandardNames.getFunctionClassId(arity), OperatorNameConventions.INVOKE), - CallableId(StandardNames.getSuspendFunctionClassId(arity), OperatorNameConventions.INVOKE) - ) + + protected fun KtBinaryExpression.getCompoundAssignKind(): KtCompoundAccess.CompoundAssign.Kind { + val compoundAssignKind = when (operationToken) { + KtTokens.PLUSEQ -> KtCompoundAccess.CompoundAssign.Kind.PLUS_ASSIGN + KtTokens.MINUSEQ -> KtCompoundAccess.CompoundAssign.Kind.MINUS_ASSIGN + KtTokens.MULTEQ -> KtCompoundAccess.CompoundAssign.Kind.TIMES_ASSIGN + KtTokens.PERCEQ -> KtCompoundAccess.CompoundAssign.Kind.REM_ASSIGN + KtTokens.DIVEQ -> KtCompoundAccess.CompoundAssign.Kind.DIV_ASSIGN + else -> error("unexpected operator $operationToken") } + return compoundAssignKind + } + + protected fun KtUnaryExpression.getInOrDecOperationKind(): KtCompoundAccess.IncOrDecOperation.Kind { + val incOrDecOperationKind = when (operationToken) { + KtTokens.PLUSPLUS -> KtCompoundAccess.IncOrDecOperation.Kind.INC + KtTokens.MINUSMINUS -> KtCompoundAccess.IncOrDecOperation.Kind.DEC + else -> error("unexpected operator $operationToken") + } + return incOrDecOperationKind + } + + protected fun KtExpression.toExplicitReceiverValue(): KtExplicitReceiverValue = + KtExplicitReceiverValue(this, isReceiverOfKtSafeQualifiedExpression(), token) + + private fun KtExpression.isReceiverOfKtSafeQualifiedExpression(): Boolean { + val safeQualifiedExpression = parentOfType() ?: return false + return KtPsiUtil.deparenthesize(safeQualifiedExpression.receiverExpression) == KtPsiUtil.deparenthesize(this) + } + + protected companion object { + val nonCallBinaryOperator = setOf(KtTokens.ELVIS, KtTokens.EQEQEQ, KtTokens.EXCLEQEQEQ) } } \ No newline at end of file diff --git a/analysis/analysis-api-impl-base/tests/org/jetbrains/kotlin/analysis/api/impl/base/test/fir/AbstractResolveCallTest.kt b/analysis/analysis-api-impl-base/tests/org/jetbrains/kotlin/analysis/api/impl/base/test/fir/AbstractResolveCallTest.kt index f35399cfb73..d3ce3eb39e3 100644 --- a/analysis/analysis-api-impl-base/tests/org/jetbrains/kotlin/analysis/api/impl/base/test/fir/AbstractResolveCallTest.kt +++ b/analysis/analysis-api-impl-base/tests/org/jetbrains/kotlin/analysis/api/impl/base/test/fir/AbstractResolveCallTest.kt @@ -7,16 +7,14 @@ package org.jetbrains.kotlin.analysis.api.impl.base.test.fir import com.intellij.psi.PsiElement import org.jetbrains.kotlin.analysis.api.KtAnalysisSession -import org.jetbrains.kotlin.analysis.api.calls.KtCall -import org.jetbrains.kotlin.analysis.api.calls.KtDelegatedConstructorCallKind -import org.jetbrains.kotlin.analysis.api.calls.KtErrorCallTarget -import org.jetbrains.kotlin.analysis.api.calls.KtSuccessCallTarget +import org.jetbrains.kotlin.analysis.api.calls.KtCallInfo +import org.jetbrains.kotlin.analysis.api.diagnostics.KtDiagnostic import org.jetbrains.kotlin.analysis.api.impl.barebone.test.FrontendApiTestConfiguratorService import org.jetbrains.kotlin.analysis.api.impl.barebone.test.expressionMarkerProvider import org.jetbrains.kotlin.analysis.api.impl.base.KtMapBackedSubstitutor import org.jetbrains.kotlin.analysis.api.impl.base.test.test.framework.AbstractHLApiSingleModuleTest import org.jetbrains.kotlin.analysis.api.symbols.* -import org.jetbrains.kotlin.analysis.api.symbols.markers.KtPossibleMemberSymbol +import org.jetbrains.kotlin.analysis.api.symbols.DebugSymbolRenderer.render import org.jetbrains.kotlin.analysis.api.types.KtSubstitutor import org.jetbrains.kotlin.analysis.api.types.KtType import org.jetbrains.kotlin.psi.* @@ -24,9 +22,8 @@ import org.jetbrains.kotlin.test.model.TestModule import org.jetbrains.kotlin.test.services.TestServices import org.jetbrains.kotlin.test.services.assertions import kotlin.reflect.KProperty1 +import kotlin.reflect.KVisibility import kotlin.reflect.full.memberProperties -import kotlin.reflect.full.primaryConstructor -import kotlin.reflect.jvm.javaGetter abstract class AbstractResolveCallTest(configurator: FrontendApiTestConfiguratorService) : AbstractHLApiSingleModuleTest(configurator) { override fun doTestByFileStructure(ktFiles: List, module: TestModule, testServices: TestServices) { @@ -41,8 +38,8 @@ abstract class AbstractResolveCallTest(configurator: FrontendApiTestConfigurator testServices.assertions.assertEqualsToTestDataFileSibling(actual) } - private fun KtAnalysisSession.resolveCall(element: PsiElement): KtCall? = when (element) { - is KtValueArgument -> resolveCall(element.getArgumentExpression()!!) + private fun KtAnalysisSession.resolveCall(element: PsiElement): KtCallInfo? = when (element) { + is KtValueArgument -> element.getArgumentExpression()?.resolveCall() is KtDeclarationModifierList -> { val annotationEntry = element.annotationEntries.singleOrNull() ?: error("Only single annotation entry is supported for now") @@ -53,74 +50,89 @@ abstract class AbstractResolveCallTest(configurator: FrontendApiTestConfigurator ?: error("Only single annotation entry is supported for now") annotationEntry.resolveCall() } - is KtSimpleNameExpression -> element.resolveAccessorCall() - is KtElement -> element.resolveCallIfPossible() + is KtElement -> element.resolveCall() else -> error("Selected element type (${element::class.simpleName}) is not supported for resolveCall()") } } -private fun KtAnalysisSession.stringRepresentation(call: KtCall): String { - fun KtType.render() = call.substitutor.substituteOrSelf(this).asStringForDebugging().replace('/', '.') - fun Any.stringValue(): String = when (this) { - is KtFunctionLikeSymbol -> buildString { - append( - when (this@stringValue) { - is KtFunctionSymbol -> callableIdIfNonLocal ?: name - is KtSamConstructorSymbol -> callableIdIfNonLocal ?: name - is KtConstructorSymbol -> "" - is KtPropertyGetterSymbol -> callableIdIfNonLocal ?: "" - is KtPropertySetterSymbol -> callableIdIfNonLocal ?: "" - else -> error("unexpected symbol kind in KtCall: ${this@stringValue::class.java}") +private fun KtAnalysisSession.stringRepresentation(call: KtCallInfo): String { + fun Any.stringValue(): String { + fun KtType.render() = asStringForDebugging().replace('/', '.') + fun String.indented() = replace("\n", "\n ") + return when (this) { + is KtFunctionLikeSymbol -> buildString { + append( + when (this@stringValue) { + is KtFunctionSymbol -> callableIdIfNonLocal ?: name + is KtSamConstructorSymbol -> callableIdIfNonLocal ?: name + is KtConstructorSymbol -> "" + is KtPropertyGetterSymbol -> callableIdIfNonLocal ?: "" + is KtPropertySetterSymbol -> callableIdIfNonLocal ?: "" + else -> error("unexpected symbol kind in KtCall: ${this@stringValue::class.java}") + } + ) + append("(") + (this@stringValue as? KtFunctionSymbol)?.receiverType?.let { receiver -> + append(": ${receiver.render()}") + if (valueParameters.isNotEmpty()) append(", ") } - ) - append("(") - (this@stringValue as? KtFunctionSymbol)?.receiverType?.let { receiver -> - append(": ${receiver.render()}") - if (valueParameters.isNotEmpty()) append(", ") - } - @Suppress("DEPRECATION") - (this@stringValue as? KtCallableSymbol)?.getDispatchReceiverType()?.let { dispatchReceiverType -> - append(": ${dispatchReceiverType.render()}") - if (valueParameters.isNotEmpty()) append(", ") + @Suppress("DEPRECATION") + (this@stringValue as? KtCallableSymbol)?.getDispatchReceiverType()?.let { dispatchReceiverType -> + append(": ${dispatchReceiverType.render()}") + if (valueParameters.isNotEmpty()) append(", ") + } + valueParameters.joinTo(this) { it.stringValue() } + append(")") + append(": ${returnType.render()}") + } + is KtValueParameterSymbol -> "${if (isVararg) "vararg " else ""}$name: ${returnType.render()}" + is KtTypeParameterSymbol -> this.nameOrAnonymous.asString() + is KtVariableSymbol -> "${if (isVal) "val" else "var"} $name: ${returnType.render()}" + is KtSymbol -> render(this) + is Boolean -> toString() + is Map<*, *> -> if (isEmpty()) "{}" else entries.joinToString( + separator = ",\n ", + prefix = "{\n ", + postfix = "\n}" + ) { (k, v) -> "${k?.stringValue()?.indented()} -> (${v?.stringValue()?.indented()})" } + is Collection<*> -> if (isEmpty()) "[]" else joinToString( + separator = ",\n ", + prefix = "[\n ", + postfix = "\n]" + ) { + it?.stringValue()?.indented() ?: "null" + } + is PsiElement -> this.text + is KtSubstitutor.Empty -> "" + is KtMapBackedSubstitutor -> { + val mappingText = getAsMap().entries + .joinToString(prefix = "{", postfix = "}") { (k, v) -> k.stringValue() + " = " + v.asStringForDebugging() } + "" + } + is KtSubstitutor -> "" + is KtDiagnostic -> "$severity<$factoryName: $defaultMessage>" + is KtType -> render() + is Enum<*> -> name + else -> buildString { + val clazz = this@stringValue::class + append(clazz.simpleName!!) + appendLine(":") + clazz.memberProperties + .filter { it.name != "token" && it.visibility == KVisibility.PUBLIC } + .joinTo(this, separator = "\n ", prefix = " ") { property -> + val name = property.name + + @Suppress("UNCHECKED_CAST") + val value = + (property as KProperty1).get(this@stringValue)?.stringValue()?.indented() + "$name = $value" + } } - valueParameters.joinTo(this) { it.stringValue() } - append(")") - append(": ${returnType.render()}") } - is KtValueParameterSymbol -> "${if (isVararg) "vararg " else ""}$name: ${returnType.render()}" - is KtTypeParameterSymbol -> this.nameOrAnonymous.asString() - is KtVariableSymbol -> "${if (isVal) "val" else "var"} $name: ${returnType.render()}" - is KtSuccessCallTarget -> symbol.stringValue() - is KtErrorCallTarget -> "ERR<${this.diagnostic.defaultMessage}, [${candidates.joinToString { it.stringValue() }}]>" - is Boolean -> toString() - is Map<*, *> -> entries.joinToString(prefix = "{ ", postfix = " }") { (k, v) -> "${k?.stringValue()} -> (${v?.stringValue()})" } - is KtExpression -> this.text - is KtDelegatedConstructorCallKind -> toString() - is KtSubstitutor.Empty -> "" - is KtMapBackedSubstitutor -> { - val mappingText = getAsMap().orEmpty().entries - .joinToString(prefix = "{", postfix = "}") { (k, v) -> k.stringValue() + " = " + v.asStringForDebugging() } - "" - } - is KtSubstitutor -> "" - else -> error("unexpected parameter type ${this::class}") } - val callInfoClass = call::class - return buildString { - append(callInfoClass.simpleName!!) - append(":\n") - val propertyByName = - callInfoClass.memberProperties.associateBy(KProperty1<*, *>::name) - callInfoClass.primaryConstructor!!.parameters - .filter { it.name != "token" } - .joinTo(this, separator = "\n") { parameter -> - val name = parameter.name!!.removePrefix("_") - val value = propertyByName[name]!!.javaGetter!!(call)?.stringValue() - "$name = $value" - } - } + return call.stringValue() } diff --git a/analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/components/KtCallResolver.kt b/analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/components/KtCallResolver.kt index e936b8be42c..1c58034f39b 100644 --- a/analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/components/KtCallResolver.kt +++ b/analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/components/KtCallResolver.kt @@ -9,7 +9,7 @@ import org.jetbrains.kotlin.analysis.api.calls.KtCallInfo import org.jetbrains.kotlin.psi.* public abstract class KtCallResolver : KtAnalysisSessionComponent() { - public abstract fun resolveCall(call: KtElement): KtCallInfo? + public abstract fun resolveCall(psi: KtElement): KtCallInfo? } public interface KtCallResolverMixIn : KtAnalysisSessionMixIn { @@ -20,9 +20,6 @@ public interface KtCallResolverMixIn : KtAnalysisSessionMixIn { public fun KtCallElement.resolveCall(): KtCallInfo = analysisSession.callResolver.resolveCall(this) ?: error("KtCallElement should always resolve to a KtCallInfo") - public fun KtBinaryExpression.resolveCall(): KtCallInfo = - analysisSession.callResolver.resolveCall(this) ?: error("KtBinaryExpression should always resolve to a KtCallInfo") - public fun KtUnaryExpression.resolveCall(): KtCallInfo = analysisSession.callResolver.resolveCall(this) ?: error("KtUnaryExpression should always resolve to a KtCallInfo") diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationEntry.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationEntry.txt index d1ed506e82d..7f7861789e4 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationEntry.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationEntry.txt @@ -1,3 +1,21 @@ -KtAnnotationCall: -argumentMapping = { Annotation("v1", "v2") -> (value: Annotation) } -targetFunction = (value: Annotation): AnnotationInner +KtSuccessCallInfo: + call = KtAnnotationCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = AnnotationInner + symbol = (value: Annotation): AnnotationInner + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = Annotation + symbol = value: Annotation + ] + argumentMapping = { + Annotation("v1", "v2") -> (KtVariableLikeSignature: + receiverType = null + returnType = Annotation + symbol = value: Annotation) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_arrayOf.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_arrayOf.txt index 16f718df21f..fdba39092d0 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_arrayOf.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_arrayOf.txt @@ -1,4 +1,22 @@ -KtFunctionCall: -argumentMapping = { arrayOf("v1", "v2") -> (vararg strings: kotlin.String) } -targetFunction = (vararg strings: kotlin.String): Annotation -substitutor = +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = Annotation + symbol = (vararg strings: kotlin.String): Annotation + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = vararg strings: kotlin.String + ] + argumentMapping = { + arrayOf("v1", "v2") -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = vararg strings: kotlin.String) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_collectionLiteral.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_collectionLiteral.txt index 57cc8df7cf7..17ae71d1918 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_collectionLiteral.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_collectionLiteral.txt @@ -1,4 +1,22 @@ -KtFunctionCall: -argumentMapping = { ["v1", "v2"] -> (vararg strings: kotlin.String) } -targetFunction = (vararg strings: kotlin.String): Annotation -substitutor = +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = Annotation + symbol = (vararg strings: kotlin.String): Annotation + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = vararg strings: kotlin.String + ] + argumentMapping = { + ["v1", "v2"] -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = vararg strings: kotlin.String) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_multipleAnnotations_arrayOf.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_multipleAnnotations_arrayOf.txt index f9f4db4abc0..90309b7b7cf 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_multipleAnnotations_arrayOf.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_multipleAnnotations_arrayOf.txt @@ -1,4 +1,26 @@ -KtFunctionCall: -argumentMapping = { Annotation("v1", "v2") -> (vararg elements: Annotation), Annotation(strings = arrayOf("v3", "v4")) -> (vararg elements: Annotation) } -targetFunction = kotlin/arrayOf(vararg elements: Annotation): kotlin.Array -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Array + symbol = kotlin/arrayOf(vararg elements: T): kotlin.Array + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = Annotation + symbol = vararg elements: T + ] + argumentMapping = { + Annotation("v1", "v2") -> (KtVariableLikeSignature: + receiverType = null + returnType = Annotation + symbol = vararg elements: T), + Annotation(strings = arrayOf("v3", "v4")) -> (KtVariableLikeSignature: + receiverType = null + returnType = Annotation + symbol = vararg elements: T) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_multipleAnnotations_collectionLiteral.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_multipleAnnotations_collectionLiteral.txt index ad92170bdc6..477d8afa1fd 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_multipleAnnotations_collectionLiteral.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_multipleAnnotations_collectionLiteral.txt @@ -1,3 +1,21 @@ -KtAnnotationCall: -argumentMapping = { [Annotation("v1", "v2"), Annotation(["v3", "v4"])] -> (vararg annos: Annotation) } -targetFunction = (vararg annos: Annotation): AnnotationArray +KtSuccessCallInfo: + call = KtAnnotationCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = AnnotationArray + symbol = (vararg annos: Annotation): AnnotationArray + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = Annotation + symbol = vararg annos: Annotation + ] + argumentMapping = { + [Annotation("v1", "v2"), Annotation(["v3", "v4"])] -> (KtVariableLikeSignature: + receiverType = null + returnType = Annotation + symbol = vararg annos: Annotation) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_noarg.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_noarg.txt index 53f68b82381..10084cdd360 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_noarg.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_noarg.txt @@ -1,4 +1,17 @@ -KtFunctionCall: -argumentMapping = { } -targetFunction = (vararg strings: kotlin.String): Annotation -substitutor = +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = Annotation + symbol = (vararg strings: kotlin.String): Annotation + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = vararg strings: kotlin.String + ] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_vararg.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_vararg.txt index 676c76cc01e..b06101c6fb5 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_vararg.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_vararg.txt @@ -1,4 +1,26 @@ -KtFunctionCall: -argumentMapping = { "v1" -> (vararg strings: kotlin.String), "v2" -> (vararg strings: kotlin.String) } -targetFunction = (vararg strings: kotlin.String): Annotation -substitutor = +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = Annotation + symbol = (vararg strings: kotlin.String): Annotation + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = vararg strings: kotlin.String + ] + argumentMapping = { + "v1" -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = vararg strings: kotlin.String), + "v2" -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = vararg strings: kotlin.String) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnDelegate.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnDelegate.txt index bfb3d0a25e7..ddb4eb2b6e5 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnDelegate.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnDelegate.txt @@ -1,3 +1,16 @@ -KtAnnotationCall: -argumentMapping = { } -targetFunction = (vararg names: kotlin.String): kotlin.Suppress +KtSuccessCallInfo: + call = KtAnnotationCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Suppress + symbol = (vararg names: kotlin.String): kotlin.Suppress + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = vararg names: kotlin.String + ] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnExpression_asT.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnExpression_asT.txt index 4937c6b0c0f..1ec11b4cf88 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnExpression_asT.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnExpression_asT.txt @@ -1,3 +1,21 @@ -KtAnnotationCall: -argumentMapping = { "UNCHECKED_CAST" -> (vararg names: kotlin.String) } -targetFunction = (vararg names: kotlin.String): kotlin.Suppress +KtSuccessCallInfo: + call = KtAnnotationCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Suppress + symbol = (vararg names: kotlin.String): kotlin.Suppress + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = vararg names: kotlin.String + ] + argumentMapping = { + "UNCHECKED_CAST" -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = vararg names: kotlin.String) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnExpression_destructuring.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnExpression_destructuring.txt index 4937c6b0c0f..1ec11b4cf88 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnExpression_destructuring.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnExpression_destructuring.txt @@ -1,3 +1,21 @@ -KtAnnotationCall: -argumentMapping = { "UNCHECKED_CAST" -> (vararg names: kotlin.String) } -targetFunction = (vararg names: kotlin.String): kotlin.Suppress +KtSuccessCallInfo: + call = KtAnnotationCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Suppress + symbol = (vararg names: kotlin.String): kotlin.Suppress + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = vararg names: kotlin.String + ] + argumentMapping = { + "UNCHECKED_CAST" -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = vararg names: kotlin.String) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnExpression_if.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnExpression_if.txt index bfb3d0a25e7..ddb4eb2b6e5 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnExpression_if.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnExpression_if.txt @@ -1,3 +1,16 @@ -KtAnnotationCall: -argumentMapping = { } -targetFunction = (vararg names: kotlin.String): kotlin.Suppress +KtSuccessCallInfo: + call = KtAnnotationCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Suppress + symbol = (vararg names: kotlin.String): kotlin.Suppress + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = vararg names: kotlin.String + ] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnExpression_whenBranch.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnExpression_whenBranch.txt index 38abfcaaaa0..d0c34b9f533 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnExpression_whenBranch.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnExpression_whenBranch.txt @@ -1,3 +1,21 @@ -KtAnnotationCall: -argumentMapping = { "DEPRECATION" -> (vararg names: kotlin.String) } -targetFunction = (vararg names: kotlin.String): kotlin.Suppress +KtSuccessCallInfo: + call = KtAnnotationCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Suppress + symbol = (vararg names: kotlin.String): kotlin.Suppress + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = vararg names: kotlin.String + ] + argumentMapping = { + "DEPRECATION" -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = vararg names: kotlin.String) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnFile.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnFile.txt index 0ff7ff611de..b6cf44d4386 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnFile.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnFile.txt @@ -1,3 +1,21 @@ -KtAnnotationCall: -argumentMapping = { "Foo" -> (name: kotlin.String) } -targetFunction = (name: kotlin.String): kotlin.jvm.JvmName +KtSuccessCallInfo: + call = KtAnnotationCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.jvm.JvmName + symbol = (name: kotlin.String): kotlin.jvm.JvmName + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = name: kotlin.String + ] + argumentMapping = { + "Foo" -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = name: kotlin.String) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnParameter_param.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnParameter_param.txt index 2db10886b03..343101cb2d7 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnParameter_param.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnParameter_param.txt @@ -1,3 +1,11 @@ -KtAnnotationCall: -argumentMapping = { } -targetFunction = (): Anno +KtSuccessCallInfo: + call = KtAnnotationCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = Anno + symbol = (): Anno + valueParameters = [] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnParameter_parameterProperty.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnParameter_parameterProperty.txt index 2db10886b03..343101cb2d7 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnParameter_parameterProperty.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnParameter_parameterProperty.txt @@ -1,3 +1,11 @@ -KtAnnotationCall: -argumentMapping = { } -targetFunction = (): Anno +KtSuccessCallInfo: + call = KtAnnotationCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = Anno + symbol = (): Anno + valueParameters = [] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnParameter_reified.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnParameter_reified.txt index 0f0858ce752..2278a8ffdc2 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnParameter_reified.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnParameter_reified.txt @@ -1,3 +1,21 @@ -KtAnnotationCall: -argumentMapping = { "s" -> (vararg names: kotlin.String) } -targetFunction = (vararg names: kotlin.String): kotlin.Suppress +KtSuccessCallInfo: + call = KtAnnotationCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Suppress + symbol = (vararg names: kotlin.String): kotlin.Suppress + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = vararg names: kotlin.String + ] + argumentMapping = { + "s" -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = vararg names: kotlin.String) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnParameter_setparam.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnParameter_setparam.txt index 2db10886b03..343101cb2d7 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnParameter_setparam.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnParameter_setparam.txt @@ -1,3 +1,11 @@ -KtAnnotationCall: -argumentMapping = { } -targetFunction = (): Anno +KtSuccessCallInfo: + call = KtAnnotationCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = Anno + symbol = (): Anno + valueParameters = [] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnProperty_field.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnProperty_field.txt index 2db10886b03..343101cb2d7 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnProperty_field.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnProperty_field.txt @@ -1,3 +1,11 @@ -KtAnnotationCall: -argumentMapping = { } -targetFunction = (): Anno +KtSuccessCallInfo: + call = KtAnnotationCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = Anno + symbol = (): Anno + valueParameters = [] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnProperty_get.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnProperty_get.txt index 2db10886b03..343101cb2d7 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnProperty_get.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnProperty_get.txt @@ -1,3 +1,11 @@ -KtAnnotationCall: -argumentMapping = { } -targetFunction = (): Anno +KtSuccessCallInfo: + call = KtAnnotationCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = Anno + symbol = (): Anno + valueParameters = [] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnProperty_property.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnProperty_property.txt index 2db10886b03..343101cb2d7 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnProperty_property.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnProperty_property.txt @@ -1,3 +1,11 @@ -KtAnnotationCall: -argumentMapping = { } -targetFunction = (): Anno +KtSuccessCallInfo: + call = KtAnnotationCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = Anno + symbol = (): Anno + valueParameters = [] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnProperty_set.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnProperty_set.txt index 2db10886b03..343101cb2d7 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnProperty_set.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnProperty_set.txt @@ -1,3 +1,11 @@ -KtAnnotationCall: -argumentMapping = { } -targetFunction = (): Anno +KtSuccessCallInfo: + call = KtAnnotationCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = Anno + symbol = (): Anno + valueParameters = [] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnReceiver.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnReceiver.txt index 2db10886b03..343101cb2d7 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnReceiver.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnReceiver.txt @@ -1,3 +1,11 @@ -KtAnnotationCall: -argumentMapping = { } -targetFunction = (): Anno +KtSuccessCallInfo: + call = KtAnnotationCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = Anno + symbol = (): Anno + valueParameters = [] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/arrayOfInAnnotation.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/arrayOfInAnnotation.txt index b02bd7a3a4b..30fd5ec2c86 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/arrayOfInAnnotation.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/arrayOfInAnnotation.txt @@ -1,4 +1,30 @@ -KtFunctionCall: -argumentMapping = { 1 -> (vararg elements: kotlin.Int), 2 -> (vararg elements: kotlin.Int), 3 -> (vararg elements: kotlin.Int) } -targetFunction = kotlin/arrayOf(vararg elements: kotlin.Int): kotlin.Array -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Array + symbol = kotlin/arrayOf(vararg elements: T): kotlin.Array + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = vararg elements: T + ] + argumentMapping = { + 1 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = vararg elements: T), + 2 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = vararg elements: T), + 3 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = vararg elements: T) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/calleeExpressionOfImplicitInvoke.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/calleeExpressionOfImplicitInvoke.kt new file mode 100644 index 00000000000..e2fa047ec39 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/calleeExpressionOfImplicitInvoke.kt @@ -0,0 +1,3 @@ +fun test(f: () -> Unit) { + f() +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/calleeExpressionOfImplicitInvoke.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/calleeExpressionOfImplicitInvoke.txt new file mode 100644 index 00000000000..8fcc016500b --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/calleeExpressionOfImplicitInvoke.txt @@ -0,0 +1,10 @@ +KtSuccessCallInfo: + call = KtSimpleVariableAccessCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Function0 + symbol = f: kotlin.Function0 + simpleAccess = Read: diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/checkNotNullCall.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/checkNotNullCall.kt new file mode 100644 index 00000000000..2c64e1ea185 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/checkNotNullCall.kt @@ -0,0 +1,3 @@ +fun test(a: Any?) { + a!! +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/checkNotNullCall.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/checkNotNullCall.txt new file mode 100644 index 00000000000..9d213ff1ef1 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/checkNotNullCall.txt @@ -0,0 +1,3 @@ +KtSuccessCallInfo: + call = KtCheckNotNullCall: + baseExpression = a \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/checkNotNullCallAsCallee.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/checkNotNullCallAsCallee.kt new file mode 100644 index 00000000000..4d87677a2c3 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/checkNotNullCallAsCallee.kt @@ -0,0 +1,3 @@ +fun test(a: (() -> Unit)?) { + a!!() +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/checkNotNullCallAsCallee.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/checkNotNullCallAsCallee.txt new file mode 100644 index 00000000000..9d213ff1ef1 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/checkNotNullCallAsCallee.txt @@ -0,0 +1,3 @@ +KtSuccessCallInfo: + call = KtCheckNotNullCall: + baseExpression = a \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/comparisonCall.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/comparisonCall.kt new file mode 100644 index 00000000000..ac74eb4cf54 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/comparisonCall.kt @@ -0,0 +1,3 @@ +fun test(i: Int, j: Int) { + i < j +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/comparisonCall.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/comparisonCall.txt new file mode 100644 index 00000000000..feb546af86c --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/comparisonCall.txt @@ -0,0 +1,24 @@ +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = i + isSafeNavigation = false + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = kotlin/Int.compareTo(: kotlin.Int, other: kotlin.Int): kotlin.Int + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = other: kotlin.Int + ] + argumentMapping = { + j -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = other: kotlin.Int) + } diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVal.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVal.kt new file mode 100644 index 00000000000..ec2346c1678 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVal.kt @@ -0,0 +1,6 @@ +interface A { + operator fun plusAssign(i: Int) +} +fun test(l: A) { + l += 1 +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVal.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVal.txt new file mode 100644 index 00000000000..bf65d9421cb --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVal.txt @@ -0,0 +1,24 @@ +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = l + isSafeNavigation = false + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Unit + symbol = /A.plusAssign(: A, i: kotlin.Int): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = i: kotlin.Int + ] + argumentMapping = { + 1 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = i: kotlin.Int) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVal_lhs.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVal_lhs.kt new file mode 100644 index 00000000000..31dc6e74c8b --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVal_lhs.kt @@ -0,0 +1,6 @@ +interface A { + operator fun plusAssign(i: Int) +} +fun test(l: A) { + l += 1 +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVal_lhs.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVal_lhs.txt new file mode 100644 index 00000000000..583ee80b68a --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVal_lhs.txt @@ -0,0 +1,10 @@ +KtSuccessCallInfo: + call = KtSimpleVariableAccessCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtVariableLikeSignature: + receiverType = null + returnType = A + symbol = l: A + simpleAccess = Read: diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVar.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVar.kt new file mode 100644 index 00000000000..3cb8cc0543e --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVar.kt @@ -0,0 +1,4 @@ +fun test() { + var i = 1 + i += 1 +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVar.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVar.txt new file mode 100644 index 00000000000..cf99c2f10c3 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVar.txt @@ -0,0 +1,27 @@ +KtSuccessCallInfo: + call = KtCompoundVariableAccessCall: + compoundAccess = CompoundAssign: + kind = PLUS_ASSIGN + operand = 1 + operationPartiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = i + isSafeNavigation = false + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = kotlin/Int.plus(: kotlin.Int, other: kotlin.Int): kotlin.Int + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = other: kotlin.Int + ] + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = var i: kotlin.Int \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVar_lhs.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVar_lhs.kt new file mode 100644 index 00000000000..25c9720b9b8 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVar_lhs.kt @@ -0,0 +1,4 @@ +fun test() { + var i = 1 + i += 1 +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVar_lhs.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVar_lhs.txt new file mode 100644 index 00000000000..8ac0368f019 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignOnVar_lhs.txt @@ -0,0 +1,10 @@ +KtSuccessCallInfo: + call = KtSimpleVariableAccessCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = var i: kotlin.Int + simpleAccess = Read: diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention.kt new file mode 100644 index 00000000000..cc9dd612c1e --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention.kt @@ -0,0 +1,8 @@ +interface MyMap { + operator fun get(k: K): V + operator fun set(k: K, v: V) +} + +fun test(m: MyMap) { + m["a"] += 1 +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention.txt new file mode 100644 index 00000000000..488f34d4f99 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention.txt @@ -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(: 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(: MyMap, k: kotlin.String): kotlin.Int + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = k: kotlin.String + ] + indexArguments = [ + "a" + ] + setPartiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = m + isSafeNavigation = false + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Unit + symbol = /MyMap.set(: MyMap, k: kotlin.String, v: kotlin.Int): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = k: kotlin.String, + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = v: kotlin.Int + ] \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention_complexReceivers.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention_complexReceivers.kt new file mode 100644 index 00000000000..ba46f2cc051 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention_complexReceivers.kt @@ -0,0 +1,11 @@ +interface MyMap { + operator fun get(k: K1): V1 +} + +interface Foo { + operator fun MyMap.set(k: K2, v: V2) + + fun test(m: MyMap) { + m["a"] += 1 + } +} diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention_complexReceivers.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention_complexReceivers.txt new file mode 100644 index 00000000000..1282a025c63 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention_complexReceivers.txt @@ -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(: 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(: MyMap, k: kotlin.String): kotlin.Int + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = k: kotlin.String + ] + 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: SOURCE + superTypes: [ + kotlin/Any + ] + symbolKind: TOP_LEVEL + typeParameters: [] + visibility: Public + extensionReceiver = KtExplicitReceiverValue: + expression = m + isSafeNavigation = false + signature = KtFunctionLikeSignature: + receiverType = MyMap + returnType = kotlin.Unit + symbol = /Foo.set(: MyMap, : 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 + ] \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention_lhs.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention_lhs.kt new file mode 100644 index 00000000000..534f949ccc9 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention_lhs.kt @@ -0,0 +1,8 @@ +interface MyMap { + operator fun get(k: K): V + operator fun set(k: K, v: V) +} + +fun test(m: MyMap) { + m["a"] += 1 +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention_lhs.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention_lhs.txt new file mode 100644 index 00000000000..ed8cd2531ab --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayAccessConvention_lhs.txt @@ -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(: MyMap, k: kotlin.String): kotlin.Int + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = k: kotlin.String + ] + argumentMapping = { + "a" -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = k: kotlin.String) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayGetConvention.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayGetConvention.kt new file mode 100644 index 00000000000..640e0be0537 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayGetConvention.kt @@ -0,0 +1,11 @@ +interface A { + operator fun plusAssign(i: Int) +} + +interface MyMap { + operator fun get(k: K): V +} + +fun test(m: MyMap) { + m["a"] += 1 +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayGetConvention.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayGetConvention.txt new file mode 100644 index 00000000000..e03ee8004f3 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayGetConvention.txt @@ -0,0 +1,24 @@ +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = m["a"] + isSafeNavigation = false + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Unit + symbol = /A.plusAssign(: A, i: kotlin.Int): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = i: kotlin.Int + ] + argumentMapping = { + 1 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = i: kotlin.Int) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayGetConvention_lhs.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayGetConvention_lhs.kt new file mode 100644 index 00000000000..497f14e34a4 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayGetConvention_lhs.kt @@ -0,0 +1,11 @@ +interface A { + operator fun plusAssign(i: Int) +} + +interface MyMap { + operator fun get(k: K): V +} + +fun test(m: MyMap) { + m["a"] += 1 +} diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayGetConvention_lhs.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayGetConvention_lhs.txt new file mode 100644 index 00000000000..e7b1ad86d4b --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/compoundAssignWithArrayGetConvention_lhs.txt @@ -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(: MyMap, k: kotlin.String): A + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = k: kotlin.String + ] + argumentMapping = { + "a" -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = k: kotlin.String) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke1.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke1.kt new file mode 100644 index 00000000000..f804e2012b5 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke1.kt @@ -0,0 +1,6 @@ +operator fun Int.invoke() : Long = 1L +operator fun Long.invoke() : Double = 1.0 +operator fun Double.invoke() {} +fun test(i: Int) { + i()()() +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke1.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke1.txt new file mode 100644 index 00000000000..14dbfb8d598 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke1.txt @@ -0,0 +1,14 @@ +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = true + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = KtExplicitReceiverValue: + expression = i + isSafeNavigation = false + signature = KtFunctionLikeSignature: + receiverType = kotlin.Int + returnType = kotlin.Long + symbol = /invoke(: kotlin.Int): kotlin.Long + valueParameters = [] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke2.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke2.kt new file mode 100644 index 00000000000..aadc9e6eaac --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke2.kt @@ -0,0 +1,6 @@ +operator fun Int.invoke() : Long = 1L +operator fun Long.invoke() : Double = 1.0 +operator fun Double.invoke() {} +fun test(i: Int) { + i()()() +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke2.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke2.txt new file mode 100644 index 00000000000..cb95ea2c7c6 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke2.txt @@ -0,0 +1,14 @@ +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = true + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = KtExplicitReceiverValue: + expression = i() + isSafeNavigation = false + signature = KtFunctionLikeSignature: + receiverType = kotlin.Long + returnType = kotlin.Double + symbol = /invoke(: kotlin.Long): kotlin.Double + valueParameters = [] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke3.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke3.kt new file mode 100644 index 00000000000..e8951792d3d --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke3.kt @@ -0,0 +1,6 @@ +operator fun Int.invoke() : Long = 1L +operator fun Long.invoke() : Double = 1.0 +operator fun Double.invoke() {} +fun test(i: Int) { + i()()() +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke3.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke3.txt new file mode 100644 index 00000000000..2bc502cb6ca --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke3.txt @@ -0,0 +1,14 @@ +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = true + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = KtExplicitReceiverValue: + expression = i()() + isSafeNavigation = false + signature = KtFunctionLikeSignature: + receiverType = kotlin.Double + returnType = kotlin.Unit + symbol = /invoke(: kotlin.Double): kotlin.Unit + valueParameters = [] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke_callee.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke_callee.kt new file mode 100644 index 00000000000..c1495ff4624 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke_callee.kt @@ -0,0 +1,6 @@ +operator fun Int.invoke() : Long = 1L +operator fun Long.invoke() : Double = 1.0 +operator fun Double.invoke() {} +fun test(i: Int) { + i()()() +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke_callee.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke_callee.txt new file mode 100644 index 00000000000..2701b397cb1 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/consecutiveImplicitInvoke_callee.txt @@ -0,0 +1,10 @@ +KtSuccessCallInfo: + call = KtSimpleVariableAccessCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = i: kotlin.Int + simpleAccess = Read: diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_super.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_super.txt index 0f012e4b3de..fed342ed066 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_super.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_super.txt @@ -1,4 +1,22 @@ -KtDelegatedConstructorCall: -argumentMapping = { i + j -> (p1: kotlin.Int) } -targetFunction = (p1: kotlin.Int): Base -kind = SUPER_CALL +KtSuccessCallInfo: + call = KtDelegatedConstructorCall: + kind = SUPER_CALL + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = Base + symbol = (p1: kotlin.Int): Base + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = p1: kotlin.Int + ] + argumentMapping = { + i + j -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = p1: kotlin.Int) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_super_unresolved.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_super_unresolved.txt index 7e2d3d7bf9a..e2a1e4e13ce 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_super_unresolved.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_super_unresolved.txt @@ -1,4 +1,25 @@ -KtDelegatedConstructorCall: -argumentMapping = { s -> (p1: kotlin.Int) } -targetFunction = ERR(p1: kotlin.Int): Base]> -kind = SUPER_CALL +KtErrorCallInfo: + candidateCalls = [ + KtDelegatedConstructorCall: + kind = SUPER_CALL + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = Base + symbol = (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 \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_this.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_this.txt index 9a84bfff4b7..bbc16e2acf1 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_this.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_this.txt @@ -1,4 +1,22 @@ -KtDelegatedConstructorCall: -argumentMapping = { s.length -> (p1: kotlin.Int) } -targetFunction = (p1: kotlin.Int): Sub -kind = THIS_CALL +KtSuccessCallInfo: + call = KtDelegatedConstructorCall: + kind = THIS_CALL + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = Sub + symbol = (p1: kotlin.Int): Sub + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = p1: kotlin.Int + ] + argumentMapping = { + s.length -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = p1: kotlin.Int) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_this_unresolved.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_this_unresolved.txt index 381157388a3..bb1de31267a 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_this_unresolved.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_this_unresolved.txt @@ -1,4 +1,40 @@ -KtDelegatedConstructorCall: -argumentMapping = { } -targetFunction = ERR(p: kotlin.Int): Sub, (i: kotlin.Int, j: kotlin.Int): Sub]> -kind = THIS_CALL +KtErrorCallInfo: + candidateCalls = [ + KtDelegatedConstructorCall: + kind = THIS_CALL + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = Sub + symbol = (p: kotlin.Int): Sub + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = p: kotlin.Int + ] + argumentMapping = {}, + KtDelegatedConstructorCall: + kind = THIS_CALL + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = Sub + symbol = (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 = {} + ] + diagnostic = ERROR \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/enumAsAnnotationValue.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/enumAsAnnotationValue.txt index 133b81208ec..fa71c4a2110 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/enumAsAnnotationValue.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/enumAsAnnotationValue.txt @@ -1,3 +1,21 @@ -KtAnnotationCall: -argumentMapping = { Color.R -> (color: Color) } -targetFunction = (color: Color): Annotation +KtSuccessCallInfo: + call = KtAnnotationCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = Annotation + symbol = (color: Color): Annotation + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = Color + symbol = color: Color + ] + argumentMapping = { + Color.R -> (KtVariableLikeSignature: + receiverType = null + returnType = Color + symbol = color: Color) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromAny.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromAny.kt new file mode 100644 index 00000000000..b1055774cc9 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromAny.kt @@ -0,0 +1,5 @@ +class B + +fun test(b1: B, b2: B) { + b1 == b2 +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromAny.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromAny.txt new file mode 100644 index 00000000000..fd77894f73b --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromAny.txt @@ -0,0 +1,24 @@ +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = b1 + isSafeNavigation = false + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Boolean + symbol = kotlin/Any.equals(: kotlin.Any, other: kotlin.Any?): kotlin.Boolean + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Any? + symbol = other: kotlin.Any? + ] + argumentMapping = { + b2 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Any? + symbol = other: kotlin.Any?) + } diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromSuperType.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromSuperType.kt new file mode 100644 index 00000000000..4ec4fecb90e --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromSuperType.kt @@ -0,0 +1,11 @@ +open class A { + override fun equals(other: Any?): Boolean { + return true + } +} + +class B : A() + +fun test(b1: B, b2: B) { + b1 == b2 +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromSuperType.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromSuperType.txt new file mode 100644 index 00000000000..21882283394 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromSuperType.txt @@ -0,0 +1,24 @@ +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = b1 + isSafeNavigation = false + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Boolean + symbol = /A.equals(: A, other: kotlin.Any?): kotlin.Boolean + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Any? + symbol = other: kotlin.Any? + ] + argumentMapping = { + b2 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Any? + symbol = other: kotlin.Any?) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_overridden.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_overridden.kt new file mode 100644 index 00000000000..8f7273ee7fd --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_overridden.kt @@ -0,0 +1,9 @@ +open class A { + override fun equals(other: Any?): Boolean { + return true + } +} + +fun test(a1: A, a2: A) { + a1 == a2 +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_overridden.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_overridden.txt new file mode 100644 index 00000000000..101a50c1dff --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_overridden.txt @@ -0,0 +1,24 @@ +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = a1 + isSafeNavigation = false + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Boolean + symbol = /A.equals(: A, other: kotlin.Any?): kotlin.Boolean + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Any? + symbol = other: kotlin.Any? + ] + argumentMapping = { + a2 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Any? + symbol = other: kotlin.Any?) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallInTheSameFile.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallInTheSameFile.txt index b4702cf592e..a6695840943 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallInTheSameFile.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallInTheSameFile.txt @@ -1,4 +1,22 @@ -KtFunctionCall: -argumentMapping = { 1 -> (a: kotlin.Int) } -targetFunction = /function(a: kotlin.Int): kotlin.Unit -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Unit + symbol = /function(a: kotlin.Int): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = a: kotlin.Int + ] + argumentMapping = { + 1 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = a: kotlin.Int) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithExtensionReceiverAndTypeArgument.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithExtensionReceiverAndTypeArgument.txt index 4f1694b3685..fd4e692d83b 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithExtensionReceiverAndTypeArgument.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithExtensionReceiverAndTypeArgument.txt @@ -1,4 +1,24 @@ -KtFunctionCall: -argumentMapping = { 1 -> (a: kotlin.Int) } -targetFunction = /function(: kotlin.String, a: kotlin.Int): kotlin.Unit -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = KtExplicitReceiverValue: + expression = "str" + isSafeNavigation = false + signature = KtFunctionLikeSignature: + receiverType = kotlin.String + returnType = kotlin.Unit + symbol = /function(: A, a: B): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = a: B + ] + argumentMapping = { + 1 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = a: B) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithLambdaArgument.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithLambdaArgument.txt index f1b41bdd439..58cb4252761 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithLambdaArgument.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithLambdaArgument.txt @@ -1,4 +1,30 @@ -KtFunctionCall: -argumentMapping = { 1 -> (a: kotlin.Int), { s -> true } -> (b: kotlin.Function1) } -targetFunction = /function(a: kotlin.Int, b: kotlin.Function1): kotlin.Unit -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Unit + symbol = /function(a: kotlin.Int, b: kotlin.Function1): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = a: kotlin.Int, + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Function1 + symbol = b: kotlin.Function1 + ] + argumentMapping = { + 1 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = a: kotlin.Int), + { s -> true } -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Function1 + symbol = b: kotlin.Function1) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithNamedArgument.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithNamedArgument.txt index eb73e53e165..42c7e90a377 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithNamedArgument.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithNamedArgument.txt @@ -1,4 +1,30 @@ -KtFunctionCall: -argumentMapping = { "foo" -> (b: kotlin.String), 1 -> (a: kotlin.Int) } -targetFunction = /function(a: kotlin.Int, b: kotlin.String): kotlin.Unit -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Unit + symbol = /function(a: kotlin.Int, b: kotlin.String): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = a: kotlin.Int, + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = b: kotlin.String + ] + argumentMapping = { + "foo" -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = b: kotlin.String), + 1 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = a: kotlin.Int) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithNonTrailingLambdaArgument.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithNonTrailingLambdaArgument.txt index f1b41bdd439..58cb4252761 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithNonTrailingLambdaArgument.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithNonTrailingLambdaArgument.txt @@ -1,4 +1,30 @@ -KtFunctionCall: -argumentMapping = { 1 -> (a: kotlin.Int), { s -> true } -> (b: kotlin.Function1) } -targetFunction = /function(a: kotlin.Int, b: kotlin.Function1): kotlin.Unit -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Unit + symbol = /function(a: kotlin.Int, b: kotlin.Function1): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = a: kotlin.Int, + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Function1 + symbol = b: kotlin.Function1 + ] + argumentMapping = { + 1 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = a: kotlin.Int), + { s -> true } -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Function1 + symbol = b: kotlin.Function1) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithSpreadArgument.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithSpreadArgument.txt index 41df0b33f47..775d535335c 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithSpreadArgument.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithSpreadArgument.txt @@ -1,4 +1,22 @@ -KtFunctionCall: -argumentMapping = { args -> (vararg a: kotlin.Int) } -targetFunction = /function(vararg a: kotlin.Int): kotlin.Unit -substitutor = +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Unit + symbol = /function(vararg a: kotlin.Int): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = vararg a: kotlin.Int + ] + argumentMapping = { + args -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = vararg a: kotlin.Int) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithTypeArgument.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithTypeArgument.txt index a42e7a09174..1e9ff2d7a0f 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithTypeArgument.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithTypeArgument.txt @@ -1,4 +1,30 @@ -KtFunctionCall: -argumentMapping = { 1 -> (a: kotlin.Int), "" -> (b: kotlin.String) } -targetFunction = /function(a: kotlin.Int, b: kotlin.String): kotlin.Unit -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Unit + symbol = /function(a: A, b: B): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = a: A, + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = b: B + ] + argumentMapping = { + 1 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = a: A), + "" -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = b: B) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithVarargArgument.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithVarargArgument.txt index 838f9384a72..53a1755e72a 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithVarargArgument.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithVarargArgument.txt @@ -1,4 +1,30 @@ -KtFunctionCall: -argumentMapping = { 1 -> (vararg a: kotlin.Int), 2 -> (vararg a: kotlin.Int), 3 -> (vararg a: kotlin.Int) } -targetFunction = /function(vararg a: kotlin.Int): kotlin.Unit -substitutor = +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Unit + symbol = /function(vararg a: kotlin.Int): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = vararg a: kotlin.Int + ] + argumentMapping = { + 1 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = vararg a: kotlin.Int), + 2 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = vararg a: kotlin.Int), + 3 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = vararg a: kotlin.Int) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/functionTypeVariableCall_dispatchReceiver.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionTypeVariableCall_dispatchReceiver.kt new file mode 100644 index 00000000000..de55bc4209f --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionTypeVariableCall_dispatchReceiver.kt @@ -0,0 +1,6 @@ +class A { + val f: String.() -> Unit = {} + fun test() { + "".f() + } +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/functionTypeVariableCall_dispatchReceiver.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionTypeVariableCall_dispatchReceiver.txt new file mode 100644 index 00000000000..e4ce17875b1 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionTypeVariableCall_dispatchReceiver.txt @@ -0,0 +1,21 @@ +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = true + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = f + isSafeNavigation = false + extensionReceiver = KtExplicitReceiverValue: + expression = "" + isSafeNavigation = false + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Unit + symbol = kotlin/Function1.invoke(: kotlin.Function1, p1: kotlin.String): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = p1: kotlin.String + ] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/functionTypeVariableCall_extensionReceiver.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionTypeVariableCall_extensionReceiver.kt new file mode 100644 index 00000000000..906ed15a5f8 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionTypeVariableCall_extensionReceiver.kt @@ -0,0 +1,7 @@ +class A { + fun test() { + "".f() + } +} + +val A.f: String.() -> Unit = {} diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/functionTypeVariableCall_extensionReceiver.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionTypeVariableCall_extensionReceiver.txt new file mode 100644 index 00000000000..e4ce17875b1 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionTypeVariableCall_extensionReceiver.txt @@ -0,0 +1,21 @@ +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = true + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = f + isSafeNavigation = false + extensionReceiver = KtExplicitReceiverValue: + expression = "" + isSafeNavigation = false + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Unit + symbol = kotlin/Function1.invoke(: kotlin.Function1, p1: kotlin.String): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = p1: kotlin.String + ] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/functionWithReceiverCall.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionWithReceiverCall.txt index 51429ad98ba..e46ff4d44f0 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/functionWithReceiverCall.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionWithReceiverCall.txt @@ -1,4 +1,24 @@ -KtFunctionCall: -argumentMapping = { 1 -> (a: kotlin.Int) } -targetFunction = /function(: kotlin.String, a: kotlin.Int): kotlin.Unit -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = KtExplicitReceiverValue: + expression = "str" + isSafeNavigation = false + signature = KtFunctionLikeSignature: + receiverType = kotlin.String + returnType = kotlin.Unit + symbol = /function(: kotlin.String, a: kotlin.Int): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = a: kotlin.Int + ] + argumentMapping = { + 1 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = a: kotlin.Int) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/functionWithReceiverSafeCall.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionWithReceiverSafeCall.txt index 51429ad98ba..ce6f1fa6609 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/functionWithReceiverSafeCall.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/functionWithReceiverSafeCall.txt @@ -1,4 +1,24 @@ -KtFunctionCall: -argumentMapping = { 1 -> (a: kotlin.Int) } -targetFunction = /function(: kotlin.String, a: kotlin.Int): kotlin.Unit -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = KtExplicitReceiverValue: + expression = "str" + isSafeNavigation = true + signature = KtFunctionLikeSignature: + receiverType = kotlin.String + returnType = kotlin.Unit + symbol = /function(: kotlin.String, a: kotlin.Int): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = a: kotlin.Int + ] + argumentMapping = { + 1 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = a: kotlin.Int) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/hiddenConstructor.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/hiddenConstructor.kt new file mode 100644 index 00000000000..93e544346ad --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/hiddenConstructor.kt @@ -0,0 +1,5 @@ +fun test() { + Obj(555) +} + +object Obj diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/hiddenConstructor.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/hiddenConstructor.txt new file mode 100644 index 00000000000..36ab8175484 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/hiddenConstructor.txt @@ -0,0 +1,15 @@ +KtErrorCallInfo: + candidateCalls = [ + KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = Obj + symbol = (): Obj + valueParameters = [] + argumentMapping = {} + ] + diagnostic = ERROR \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/hiddenDeprecated.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/hiddenDeprecated.kt new file mode 100644 index 00000000000..f64f0ad6a5b --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/hiddenDeprecated.kt @@ -0,0 +1,6 @@ +@Deprecated("", level=DeprecationLevel.HIDDEN) +fun a() {} + +fun test() { + a() +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/hiddenDeprecated.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/hiddenDeprecated.txt new file mode 100644 index 00000000000..e2779c595a9 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/hiddenDeprecated.txt @@ -0,0 +1,3 @@ +KtErrorCallInfo: + candidateCalls = [] + diagnostic = ERROR \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/implicitConstructorDelegationCall.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/implicitConstructorDelegationCall.txt index 0ba7ff24df2..db0f00e2c2b 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/implicitConstructorDelegationCall.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/implicitConstructorDelegationCall.txt @@ -1,4 +1,22 @@ -KtFunctionCall: -argumentMapping = { 42 -> (i: kotlin.Int) } -targetFunction = (i: kotlin.Int): A -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = A + symbol = (i: kotlin.Int): A + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = i: kotlin.Int + ] + argumentMapping = { + 42 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = i: kotlin.Int) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/implicitConstuctorCall.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/implicitConstuctorCall.txt index 92168086499..39e131b7cc8 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/implicitConstuctorCall.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/implicitConstuctorCall.txt @@ -1,4 +1,12 @@ -KtFunctionCall: -argumentMapping = { } -targetFunction = (): A -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = A + symbol = (): A + valueParameters = [] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/implicitJavaConstuctorCall.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/implicitJavaConstuctorCall.txt index 92168086499..39e131b7cc8 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/implicitJavaConstuctorCall.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/implicitJavaConstuctorCall.txt @@ -1,4 +1,12 @@ -KtFunctionCall: -argumentMapping = { } -targetFunction = (): A -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = A + symbol = (): A + valueParameters = [] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/indexedGet.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/indexedGet.txt index 2f9c3deb0c9..9552e772e20 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/indexedGet.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/indexedGet.txt @@ -1,4 +1,32 @@ -KtFunctionCall: -argumentMapping = { 1 -> (a: kotlin.Int), "foo" -> (b: kotlin.String) } -targetFunction = /C.get(: C, a: kotlin.Int, b: kotlin.String): kotlin.Boolean -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = c + isSafeNavigation = false + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Boolean + symbol = /C.get(: 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) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/indexedGetWithNotEnoughArgs.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/indexedGetWithNotEnoughArgs.txt index f6e85e290a8..a854aa81c8c 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/indexedGetWithNotEnoughArgs.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/indexedGetWithNotEnoughArgs.txt @@ -1,4 +1,31 @@ -KtFunctionCall: -argumentMapping = { 1 -> (a: kotlin.Int) } -targetFunction = ERR: C, a: kotlin.Int, b: kotlin.String): kotlin.Boolean]> -substitutor = \ No newline at end of file +KtErrorCallInfo: + candidateCalls = [ + KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = c + isSafeNavigation = false + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Boolean + symbol = /C.get(: 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) + } + ] + diagnostic = ERROR \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/indexedGetWithTooManyArgs.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/indexedGetWithTooManyArgs.txt index 0dbc156dd71..0d07d0f1ba6 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/indexedGetWithTooManyArgs.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/indexedGetWithTooManyArgs.txt @@ -1,4 +1,35 @@ -KtFunctionCall: -argumentMapping = { 1 -> (a: kotlin.Int), "foo" -> (b: kotlin.String) } -targetFunction = ERR: C, a: kotlin.Int, b: kotlin.String): kotlin.Boolean]> -substitutor = \ No newline at end of file +KtErrorCallInfo: + candidateCalls = [ + KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = c + isSafeNavigation = false + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Boolean + symbol = /C.get(: 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 \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/indexedSet.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/indexedSet.txt index 6f3bf2f7e57..f821de58184 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/indexedSet.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/indexedSet.txt @@ -1,4 +1,40 @@ -KtFunctionCall: -argumentMapping = { 1 -> (a: kotlin.Int), "foo" -> (b: kotlin.String), false -> (value: kotlin.Boolean) } -targetFunction = /C.set(: C, a: kotlin.Int, b: kotlin.String, value: kotlin.Boolean): kotlin.Unit -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = c + isSafeNavigation = false + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Unit + symbol = /C.set(: 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), + false -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Boolean + symbol = value: kotlin.Boolean) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/indexedSetWithNotEnoughArgs.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/indexedSetWithNotEnoughArgs.txt index 0a5dce54de6..c794d7db761 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/indexedSetWithNotEnoughArgs.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/indexedSetWithNotEnoughArgs.txt @@ -1,4 +1,39 @@ -KtFunctionCall: -argumentMapping = { 1 -> (a: kotlin.Int), false -> (value: kotlin.Boolean) } -targetFunction = ERR: C, a: kotlin.Int, b: kotlin.String, value: kotlin.Boolean): kotlin.Unit]> -substitutor = \ No newline at end of file +KtErrorCallInfo: + candidateCalls = [ + KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = c + isSafeNavigation = false + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Unit + symbol = /C.set(: 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), + false -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Boolean + symbol = value: kotlin.Boolean) + } + ] + diagnostic = ERROR \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/indexedSetWithTooManyArgs.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/indexedSetWithTooManyArgs.txt index bd8a5d29817..a16d635ab20 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/indexedSetWithTooManyArgs.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/indexedSetWithTooManyArgs.txt @@ -1,4 +1,43 @@ -KtFunctionCall: -argumentMapping = { 1 -> (a: kotlin.Int), "foo" -> (b: kotlin.String), false -> (value: kotlin.Boolean) } -targetFunction = ERR: C, a: kotlin.Int, b: kotlin.String, value: kotlin.Boolean): kotlin.Unit]> -substitutor = \ No newline at end of file +KtErrorCallInfo: + candidateCalls = [ + KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = c + isSafeNavigation = false + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Unit + symbol = /C.set(: 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), + false -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Boolean + symbol = value: kotlin.Boolean) + } + ] + diagnostic = ERROR \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/intArrayOfInAnnotation.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/intArrayOfInAnnotation.txt index 4e66d80ce6b..45a3acb85fa 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/intArrayOfInAnnotation.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/intArrayOfInAnnotation.txt @@ -1,4 +1,30 @@ -KtFunctionCall: -argumentMapping = { 1 -> (vararg elements: kotlin.Int), 2 -> (vararg elements: kotlin.Int), 3 -> (vararg elements: kotlin.Int) } -targetFunction = kotlin/intArrayOf(vararg elements: kotlin.Int): kotlin.IntArray -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.IntArray + symbol = kotlin/intArrayOf(vararg elements: kotlin.Int): kotlin.IntArray + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = vararg elements: kotlin.Int + ] + argumentMapping = { + 1 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = vararg elements: kotlin.Int), + 2 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = vararg elements: kotlin.Int), + 3 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = vararg elements: kotlin.Int) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/javaFunctionCall.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/javaFunctionCall.txt index f1d9c60766e..70ee8bad69a 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/javaFunctionCall.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/javaFunctionCall.txt @@ -1,4 +1,14 @@ -KtFunctionCall: -argumentMapping = { } -targetFunction = /JavaClass.javaMethod(: JavaClass): kotlin.Unit -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = javaClass + isSafeNavigation = false + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Unit + symbol = /JavaClass.javaMethod(: JavaClass): kotlin.Unit + valueParameters = [] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertyGetter.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertyGetter.txt index 45451cb00e4..0ed3051a953 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertyGetter.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertyGetter.txt @@ -1,4 +1,12 @@ -KtFunctionCall: -argumentMapping = { } -targetFunction = /JavaClass.getFoo(: JavaClass): kotlin.Int -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleVariableAccessCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = javaClass + isSafeNavigation = false + extensionReceiver = null + signature = KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = val foo: kotlin.Int + simpleAccess = Read: diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertyGetter_unqualified.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertyGetter_unqualified.txt index 45451cb00e4..dfde07cea1e 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertyGetter_unqualified.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertyGetter_unqualified.txt @@ -1,4 +1,13 @@ -KtFunctionCall: -argumentMapping = { } -targetFunction = /JavaClass.getFoo(: JavaClass): kotlin.Int -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleVariableAccessCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtImplicitReceiverValue: + symbol = KtReceiverParameterSymbol: + origin: SOURCE + type: JavaClass + extensionReceiver = null + signature = KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = val foo: kotlin.Int + simpleAccess = Read: diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertyNestedGetter.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertyNestedGetter.txt index 69234be9833..237627db6a9 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertyNestedGetter.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertyNestedGetter.txt @@ -1,4 +1,12 @@ -KtFunctionCall: -argumentMapping = { } -targetFunction = /JavaClass.getSub(: JavaClass): ft -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleVariableAccessCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = javaClass + isSafeNavigation = false + extensionReceiver = null + signature = KtVariableLikeSignature: + receiverType = null + returnType = ft + symbol = val sub: ft + simpleAccess = Read: diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertySetter.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertySetter.txt index e74a4608d13..398a31ee073 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertySetter.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertySetter.txt @@ -1,4 +1,13 @@ -KtFunctionCall: -argumentMapping = { 42 -> (v: kotlin.Int) } -targetFunction = /JavaClass.setFoo(: JavaClass, v: kotlin.Int): kotlin.Unit -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleVariableAccessCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = javaClass + isSafeNavigation = false + extensionReceiver = null + signature = KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = var foo: kotlin.Int + simpleAccess = Write: + value = 42 \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertySetterIncomplete.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertySetterIncomplete.txt index 12ff065f1ff..5029e8e6c6f 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertySetterIncomplete.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertySetterIncomplete.txt @@ -1,4 +1,13 @@ -KtFunctionCall: -argumentMapping = { } -targetFunction = ERR: JavaClass, v: kotlin.Int): kotlin.Unit]> -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleVariableAccessCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = javaClass + isSafeNavigation = false + extensionReceiver = null + signature = KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = var foo: kotlin.Int + simpleAccess = Write: + value = null \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertySetter_unqualified.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertySetter_unqualified.txt index 9e2a274fba3..f6db6a816c0 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertySetter_unqualified.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/javaPropertySetter_unqualified.txt @@ -1,4 +1,14 @@ -KtFunctionCall: -argumentMapping = { 42 -> (v: kotlin.Int) } -targetFunction = /JavaClass.setFoo(: JavaClass, v: kotlin.Int): kotlin.Unit -substitutor = +KtSuccessCallInfo: + call = KtSimpleVariableAccessCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtImplicitReceiverValue: + symbol = KtReceiverParameterSymbol: + origin: SOURCE + type: JavaClass + extensionReceiver = null + signature = KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = var foo: kotlin.Int + simpleAccess = Write: + value = 42 \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertyGetter.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertyGetter.txt index 6115b7389b2..590a703c0ba 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertyGetter.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertyGetter.txt @@ -1,4 +1,12 @@ -KtFunctionCall: -argumentMapping = { } -targetFunction = (): kotlin.Int -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleVariableAccessCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = ktClass + isSafeNavigation = false + extensionReceiver = null + signature = KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = val foo: kotlin.Int + simpleAccess = Read: diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertyGetter_unqualified.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertyGetter_unqualified.txt index 282e4d87bfe..c8d33cdf20f 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertyGetter_unqualified.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertyGetter_unqualified.txt @@ -1,4 +1,13 @@ -KtFunctionCall: -argumentMapping = { } -targetFunction = (: A): kotlin.Int -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleVariableAccessCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtImplicitReceiverValue: + symbol = KtReceiverParameterSymbol: + origin: SOURCE + type: A + extensionReceiver = null + signature = KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = val i: kotlin.Int + simpleAccess = Read: diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertyNestedGetter.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertyNestedGetter.txt index 5baba842987..78e758e060f 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertyNestedGetter.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertyNestedGetter.txt @@ -1,4 +1,12 @@ -KtFunctionCall: -argumentMapping = { } -targetFunction = (: KtClass): KtSubClass -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleVariableAccessCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = ktClass + isSafeNavigation = false + extensionReceiver = null + signature = KtVariableLikeSignature: + receiverType = null + returnType = KtSubClass + symbol = val instance: KtSubClass + simpleAccess = Read: diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertySetter.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertySetter.txt index d7d54d9a9db..e21894784f2 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertySetter.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertySetter.txt @@ -1,4 +1,13 @@ -KtFunctionCall: -argumentMapping = { 42 -> (value: kotlin.Int) } -targetFunction = (: KtClass, value: kotlin.Int): kotlin.Unit -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleVariableAccessCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = ktClass + isSafeNavigation = false + extensionReceiver = null + signature = KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = var foo: kotlin.Int + simpleAccess = Write: + value = 42 \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertySetter_unqualified.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertySetter_unqualified.txt index 9b309d1b8d0..c717f98bc1c 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertySetter_unqualified.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/kotlinPropertySetter_unqualified.txt @@ -1,4 +1,14 @@ -KtFunctionCall: -argumentMapping = { 1 -> (value: kotlin.Int) } -targetFunction = (: A, value: kotlin.Int): kotlin.Unit -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleVariableAccessCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtImplicitReceiverValue: + symbol = KtReceiverParameterSymbol: + origin: SOURCE + type: A + extensionReceiver = null + signature = KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = var i: kotlin.Int + simpleAccess = Write: + value = 1 \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/memberFunctionCallWithTypeArgument.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/memberFunctionCallWithTypeArgument.txt index 8004b408882..c1cca76d87a 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/memberFunctionCallWithTypeArgument.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/memberFunctionCallWithTypeArgument.txt @@ -1,4 +1,24 @@ -KtFunctionCall: -argumentMapping = { 1 -> (r: kotlin.Int) } -targetFunction = /A.foo(: A, r: R): kotlin.Unit -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = a + isSafeNavigation = false + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Unit + symbol = /A.foo(: A, r: R): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = r: R + ] + argumentMapping = { + 1 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = r: R) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorOnVar.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorOnVar.kt new file mode 100644 index 00000000000..57ade33533a --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorOnVar.kt @@ -0,0 +1,4 @@ +fun test() { + var i = 1 + i++ +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorOnVar.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorOnVar.txt new file mode 100644 index 00000000000..d82c447e07c --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorOnVar.txt @@ -0,0 +1,22 @@ +KtSuccessCallInfo: + call = KtCompoundVariableAccessCall: + compoundAccess = IncOrDecOperation: + kind = INC + precedence = POSTFIX + operationPartiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = i + isSafeNavigation = false + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = kotlin/Int.inc(: kotlin.Int): kotlin.Int + valueParameters = [] + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = var i: kotlin.Int \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorOnVar_base.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorOnVar_base.kt new file mode 100644 index 00000000000..25eef068d0f --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorOnVar_base.kt @@ -0,0 +1,4 @@ +fun test() { + var i = 1 + i++ +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorOnVar_base.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorOnVar_base.txt new file mode 100644 index 00000000000..8ac0368f019 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorOnVar_base.txt @@ -0,0 +1,10 @@ +KtSuccessCallInfo: + call = KtSimpleVariableAccessCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = var i: kotlin.Int + simpleAccess = Read: diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention.kt new file mode 100644 index 00000000000..59789b3f1f1 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention.kt @@ -0,0 +1,8 @@ +interface MyMap { + operator fun get(k: K): V + operator fun set(k: K, v: V) +} + +fun test(m: MyMap) { + m["a"]++ +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention.txt new file mode 100644 index 00000000000..9ce01ac220c --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention.txt @@ -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(: 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(: MyMap, k: kotlin.String): kotlin.Int + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = k: kotlin.String + ] + indexArguments = [ + "a" + ] + setPartiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = m + isSafeNavigation = false + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Unit + symbol = /MyMap.set(: MyMap, k: kotlin.String, v: kotlin.Int): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = k: kotlin.String, + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = v: kotlin.Int + ] \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention_base.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention_base.kt new file mode 100644 index 00000000000..06586cc3d6e --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention_base.kt @@ -0,0 +1,8 @@ +interface MyMap { + operator fun get(k: K): V + operator fun set(k: K, v: V) +} + +fun test(m: MyMap) { + m["a"]++ +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention_base.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention_base.txt new file mode 100644 index 00000000000..ed8cd2531ab --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention_base.txt @@ -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(: MyMap, k: kotlin.String): kotlin.Int + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = k: kotlin.String + ] + argumentMapping = { + "a" -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = k: kotlin.String) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention_complexDispatcher.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention_complexDispatcher.kt new file mode 100644 index 00000000000..4f0bd72440a --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention_complexDispatcher.kt @@ -0,0 +1,11 @@ +interface MyMap { + operator fun get(k: K1): V1 +} + +interface Foo { + operator fun MyMap.set(k: K2, v: V2) + + fun test(m: MyMap) { + m["a"]++ + } +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention_complexDispatcher.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention_complexDispatcher.txt new file mode 100644 index 00000000000..514f6dfc29b --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/postfixUnaryOperatorWithArrayAccessConvention_complexDispatcher.txt @@ -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(: 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(: MyMap, k: kotlin.String): kotlin.Int + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = k: kotlin.String + ] + 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: SOURCE + superTypes: [ + kotlin/Any + ] + symbolKind: TOP_LEVEL + typeParameters: [] + visibility: Public + extensionReceiver = KtExplicitReceiverValue: + expression = m + isSafeNavigation = false + signature = KtFunctionLikeSignature: + receiverType = MyMap + returnType = kotlin.Unit + symbol = /Foo.set(: MyMap, : 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 + ] \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorOnVar.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorOnVar.kt new file mode 100644 index 00000000000..35e77c3cfa7 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorOnVar.kt @@ -0,0 +1,4 @@ +fun test() { + var i = 1 + ++i +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorOnVar.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorOnVar.txt new file mode 100644 index 00000000000..a79b187e3fe --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorOnVar.txt @@ -0,0 +1,22 @@ +KtSuccessCallInfo: + call = KtCompoundVariableAccessCall: + compoundAccess = IncOrDecOperation: + kind = INC + precedence = PREFIX + operationPartiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = i + isSafeNavigation = false + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = kotlin/Int.inc(: kotlin.Int): kotlin.Int + valueParameters = [] + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = var i: kotlin.Int \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorOnVar_base.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorOnVar_base.kt new file mode 100644 index 00000000000..648d95bb5e5 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorOnVar_base.kt @@ -0,0 +1,4 @@ +fun test() { + var i = 1 + ++i +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorOnVar_base.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorOnVar_base.txt new file mode 100644 index 00000000000..8ac0368f019 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorOnVar_base.txt @@ -0,0 +1,10 @@ +KtSuccessCallInfo: + call = KtSimpleVariableAccessCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = var i: kotlin.Int + simpleAccess = Read: diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention.kt new file mode 100644 index 00000000000..bf1e5af6362 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention.kt @@ -0,0 +1,8 @@ +interface MyMap { + operator fun get(k: K): V + operator fun set(k: K, v: V) +} + +fun test(m: MyMap) { + ++m["a"] +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention.txt new file mode 100644 index 00000000000..8762fa13178 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention.txt @@ -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(: 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(: MyMap, k: kotlin.String): kotlin.Int + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = k: kotlin.String + ] + indexArguments = [ + "a" + ] + setPartiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = m + isSafeNavigation = false + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Unit + symbol = /MyMap.set(: MyMap, k: kotlin.String, v: kotlin.Int): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = k: kotlin.String, + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = v: kotlin.Int + ] \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention_base.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention_base.kt new file mode 100644 index 00000000000..a09f85a03be --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention_base.kt @@ -0,0 +1,8 @@ +interface MyMap { + operator fun get(k: K): V + operator fun set(k: K, v: V) +} + +fun test(m: MyMap) { + ++m["a"] +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention_base.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention_base.txt new file mode 100644 index 00000000000..ed8cd2531ab --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention_base.txt @@ -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(: MyMap, k: kotlin.String): kotlin.Int + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = k: kotlin.String + ] + argumentMapping = { + "a" -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = k: kotlin.String) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention_complexDispatcher.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention_complexDispatcher.kt new file mode 100644 index 00000000000..e39ec051a19 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention_complexDispatcher.kt @@ -0,0 +1,11 @@ +interface MyMap { + operator fun get(k: K1): V1 +} + +interface Foo { + operator fun MyMap.set(k: K2, v: V2) + + fun test(m: MyMap) { + ++m["a"] + } +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention_complexDispatcher.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention_complexDispatcher.txt new file mode 100644 index 00000000000..3f6c7137b8a --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/prefixUnaryOperatorWithArrayAccessConvention_complexDispatcher.txt @@ -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(: 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(: MyMap, k: kotlin.String): kotlin.Int + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = k: kotlin.String + ] + 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: SOURCE + superTypes: [ + kotlin/Any + ] + symbolKind: TOP_LEVEL + typeParameters: [] + visibility: Public + extensionReceiver = KtExplicitReceiverValue: + expression = m + isSafeNavigation = false + signature = KtFunctionLikeSignature: + receiverType = MyMap + returnType = kotlin.Unit + symbol = /Foo.set(: MyMap, : 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 + ] \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/privateMember.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/privateMember.kt new file mode 100644 index 00000000000..9c58848957b --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/privateMember.kt @@ -0,0 +1,7 @@ +class A { + private fun foo() {} +} + +fun test(a: A) { + a.foo() +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/privateMember.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/privateMember.txt new file mode 100644 index 00000000000..19b5ea45b33 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/privateMember.txt @@ -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(: A): kotlin.Unit + valueParameters = [] + argumentMapping = {} + ] + diagnostic = ERROR \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/qualifiedCalleeExpressionOfImplicitInvoke.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/qualifiedCalleeExpressionOfImplicitInvoke.kt new file mode 100644 index 00000000000..becc8454db9 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/qualifiedCalleeExpressionOfImplicitInvoke.kt @@ -0,0 +1,6 @@ +interface A { + val f: () -> Unit +} +fun test(a: A) { + a.f() +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/qualifiedCalleeExpressionOfImplicitInvoke.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/qualifiedCalleeExpressionOfImplicitInvoke.txt new file mode 100644 index 00000000000..4911f5b0542 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/qualifiedCalleeExpressionOfImplicitInvoke.txt @@ -0,0 +1,12 @@ +KtSuccessCallInfo: + call = KtSimpleVariableAccessCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = a + isSafeNavigation = false + extensionReceiver = null + signature = KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Function0 + symbol = val f: kotlin.Function0 + simpleAccess = Read: diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/resolveCallInSuperConstructorParam.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/resolveCallInSuperConstructorParam.txt index f982f2656d6..b3c8d849332 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/resolveCallInSuperConstructorParam.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/resolveCallInSuperConstructorParam.txt @@ -1,4 +1,24 @@ -KtFunctionCall: -argumentMapping = { 2 -> (other: kotlin.Int) } -targetFunction = /to(: kotlin.Int, other: kotlin.Int): kotlin.Int -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = KtExplicitReceiverValue: + expression = 1 + isSafeNavigation = false + signature = KtFunctionLikeSignature: + receiverType = kotlin.Int + returnType = kotlin.Int + symbol = /to(: A, other: B): A + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = other: B + ] + argumentMapping = { + 2 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = other: B) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/samConstructorCall.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/samConstructorCall.txt index 90653956697..095a280bf90 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/samConstructorCall.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/samConstructorCall.txt @@ -1,4 +1,22 @@ -KtFunctionCall: -argumentMapping = { {x: Int, y: Int -> 1} -> (function: kotlin.Function2, ft, kotlin.Int>) } -targetFunction = java/util/Comparator(function: kotlin.Function2, ft, kotlin.Int>): java.util.Comparator> -substitutor = }> \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = java.util.Comparator> + symbol = java/util/Comparator(function: kotlin.Function2, ft, kotlin.Int>): java.util.Comparator + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Function2, ft, kotlin.Int> + symbol = function: kotlin.Function2, ft, kotlin.Int> + ] + argumentMapping = { + {x: Int, y: Int -> 1} -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Function2, ft, kotlin.Int> + symbol = function: kotlin.Function2, ft, kotlin.Int>) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/simpleCallWithNonMatchingArgs.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/simpleCallWithNonMatchingArgs.txt index 9b3f8710381..58a31ff70ae 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/simpleCallWithNonMatchingArgs.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/simpleCallWithNonMatchingArgs.txt @@ -1,4 +1,15 @@ -KtFunctionCall: -argumentMapping = { } -targetFunction = ERR -substitutor = \ No newline at end of file +KtErrorCallInfo: + candidateCalls = [ + KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Unit + symbol = /foo(): kotlin.Unit + valueParameters = [] + argumentMapping = {} + ] + diagnostic = ERROR \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastExplicitDispatchReceiver.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastExplicitDispatchReceiver.kt new file mode 100644 index 00000000000..7a89dd592b8 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastExplicitDispatchReceiver.kt @@ -0,0 +1,5 @@ +fun test(a: Any) { + if (a is String) { + a.length + } +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastExplicitDispatchReceiver.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastExplicitDispatchReceiver.txt new file mode 100644 index 00000000000..7754b56f7ef --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastExplicitDispatchReceiver.txt @@ -0,0 +1,14 @@ +KtSuccessCallInfo: + call = KtSimpleVariableAccessCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtSmartCastedReceiverValue: + original = KtExplicitReceiverValue: + expression = a + isSafeNavigation = false + smartCastType = kotlin.String + extensionReceiver = null + signature = KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = val length: kotlin.Int + simpleAccess = Read: diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastExplicitExtensionReceiver.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastExplicitExtensionReceiver.kt new file mode 100644 index 00000000000..8cefc0e5b3b --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastExplicitExtensionReceiver.kt @@ -0,0 +1,7 @@ +fun test(a: Any) { + if (a is String) { + a.foo() + } +} + +fun String.foo() {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastExplicitExtensionReceiver.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastExplicitExtensionReceiver.txt new file mode 100644 index 00000000000..1f9212e4820 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastExplicitExtensionReceiver.txt @@ -0,0 +1,16 @@ +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = KtSmartCastedReceiverValue: + original = KtExplicitReceiverValue: + expression = a + isSafeNavigation = false + smartCastType = kotlin.String + signature = KtFunctionLikeSignature: + receiverType = kotlin.String + returnType = kotlin.Unit + symbol = /foo(: kotlin.String): kotlin.Unit + valueParameters = [] + argumentMapping = {} diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastImplicitDispatchReceiver.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastImplicitDispatchReceiver.kt new file mode 100644 index 00000000000..308a2ddde95 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastImplicitDispatchReceiver.kt @@ -0,0 +1,5 @@ +fun Any.test() { + if (this is String) { + length + } +} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastImplicitDispatchReceiver.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastImplicitDispatchReceiver.txt new file mode 100644 index 00000000000..25d805f11a6 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastImplicitDispatchReceiver.txt @@ -0,0 +1,15 @@ +KtSuccessCallInfo: + call = KtSimpleVariableAccessCall: + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtSmartCastedReceiverValue: + original = KtImplicitReceiverValue: + symbol = KtReceiverParameterSymbol: + origin: SOURCE + type: kotlin/Any + smartCastType = kotlin.String + extensionReceiver = null + signature = KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = val length: kotlin.Int + simpleAccess = Read: diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastImplicitExtensionReceiver.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastImplicitExtensionReceiver.kt new file mode 100644 index 00000000000..6cf5b685c07 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastImplicitExtensionReceiver.kt @@ -0,0 +1,7 @@ +fun Any.test() { + if (this is String) { + foo() + } +} + +fun String.foo() {} diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastImplicitExtensionReceiver.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastImplicitExtensionReceiver.txt new file mode 100644 index 00000000000..a4062f4530b --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/smartCastImplicitExtensionReceiver.txt @@ -0,0 +1,17 @@ +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = KtSmartCastedReceiverValue: + original = KtImplicitReceiverValue: + symbol = KtReceiverParameterSymbol: + origin: SOURCE + type: kotlin/Any + smartCastType = kotlin.String + signature = KtFunctionLikeSignature: + receiverType = kotlin.String + returnType = kotlin.Unit + symbol = /foo(: kotlin.String): kotlin.Unit + valueParameters = [] + argumentMapping = {} diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/unresolvedSuperReference.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/unresolvedSuperReference.txt index 5596e333b8d..4ee017f7063 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/unresolvedSuperReference.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/unresolvedSuperReference.txt @@ -1,4 +1,3 @@ -KtDelegatedConstructorCall: -argumentMapping = { } -targetFunction = ERR -kind = SUPER_CALL +KtErrorCallInfo: + candidateCalls = [] + diagnostic = ERROR \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunction.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunction.txt index 0da7df42a92..e945e8e05fe 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunction.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunction.txt @@ -1,5 +1,24 @@ -KtFunctionalTypeVariableCall: -target = x: kotlin.Function1 -argumentMapping = { 1 -> (p1: kotlin.Int) } -targetFunction = kotlin/Function1.invoke(: kotlin.Function1, p1: kotlin.Int): kotlin.String -substitutor = \ No newline at end of file +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(: kotlin.Function1, p1: kotlin.Int): kotlin.String + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = p1: kotlin.Int + ] + argumentMapping = { + 1 -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.Int + symbol = p1: kotlin.Int) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionLikeCall.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionLikeCall.txt index a29b36a748b..8d3e84b6922 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionLikeCall.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionLikeCall.txt @@ -1,5 +1,14 @@ -KtVariableWithInvokeFunctionCall: -target = x: kotlin.Int -argumentMapping = { } -targetFunction = /invoke(: kotlin.Int): kotlin.String -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = true + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = KtExplicitReceiverValue: + expression = x + isSafeNavigation = false + signature = KtFunctionLikeSignature: + receiverType = kotlin.Int + returnType = kotlin.String + symbol = /invoke(: kotlin.Int): kotlin.String + valueParameters = [] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterName.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterName.txt index 49a286f50bd..3b2ffd43213 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterName.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterName.txt @@ -1,5 +1,23 @@ -KtFunctionalTypeVariableCall: -target = x: kotlin.Function2<@R|kotlin.ParameterName|(name = String(a)) kotlin.Int, @R|kotlin.ParameterName|(name = String(b)) kotlin.String, kotlin.Unit> -argumentMapping = { 1 -> (a: @R|kotlin.ParameterName|(name = String(a)) kotlin.Int), "" -> (b: @R|kotlin.ParameterName|(name = String(b)) kotlin.String) } -targetFunction = kotlin/Function2.invoke(: kotlin.Function2<@R|kotlin.ParameterName|(name = String(a)) kotlin.Int, @R|kotlin.ParameterName|(name = String(b)) kotlin.String, kotlin.Unit>, a: @R|kotlin.ParameterName|(name = String(a)) kotlin.Int, b: @R|kotlin.ParameterName|(name = String(b)) kotlin.String): kotlin.Unit -substitutor = +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(: kotlin.Function2<@R|kotlin.ParameterName|(name = String(a)) kotlin.Int, @R|kotlin.ParameterName|(name = String(b)) kotlin.String, kotlin.Unit>, a: @R|kotlin.ParameterName|(name = String(a)) kotlin.Int, b: @R|kotlin.ParameterName|(name = String(b)) kotlin.String): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = @R|kotlin.ParameterName|(name = String(a)) kotlin.Int + symbol = a: @R|kotlin.ParameterName|(name = String(a)) kotlin.Int, + KtVariableLikeSignature: + receiverType = null + returnType = @R|kotlin.ParameterName|(name = String(b)) kotlin.String + symbol = b: @R|kotlin.ParameterName|(name = String(b)) kotlin.String + ] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameAnnotation.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameAnnotation.txt index 49a286f50bd..3b2ffd43213 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameAnnotation.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameAnnotation.txt @@ -1,5 +1,23 @@ -KtFunctionalTypeVariableCall: -target = x: kotlin.Function2<@R|kotlin.ParameterName|(name = String(a)) kotlin.Int, @R|kotlin.ParameterName|(name = String(b)) kotlin.String, kotlin.Unit> -argumentMapping = { 1 -> (a: @R|kotlin.ParameterName|(name = String(a)) kotlin.Int), "" -> (b: @R|kotlin.ParameterName|(name = String(b)) kotlin.String) } -targetFunction = kotlin/Function2.invoke(: kotlin.Function2<@R|kotlin.ParameterName|(name = String(a)) kotlin.Int, @R|kotlin.ParameterName|(name = String(b)) kotlin.String, kotlin.Unit>, a: @R|kotlin.ParameterName|(name = String(a)) kotlin.Int, b: @R|kotlin.ParameterName|(name = String(b)) kotlin.String): kotlin.Unit -substitutor = +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(: kotlin.Function2<@R|kotlin.ParameterName|(name = String(a)) kotlin.Int, @R|kotlin.ParameterName|(name = String(b)) kotlin.String, kotlin.Unit>, a: @R|kotlin.ParameterName|(name = String(a)) kotlin.Int, b: @R|kotlin.ParameterName|(name = String(b)) kotlin.String): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = @R|kotlin.ParameterName|(name = String(a)) kotlin.Int + symbol = a: @R|kotlin.ParameterName|(name = String(a)) kotlin.Int, + KtVariableLikeSignature: + receiverType = null + returnType = @R|kotlin.ParameterName|(name = String(b)) kotlin.String + symbol = b: @R|kotlin.ParameterName|(name = String(b)) kotlin.String + ] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameAnnotationConflict.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameAnnotationConflict.txt index 49a286f50bd..3b2ffd43213 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameAnnotationConflict.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameAnnotationConflict.txt @@ -1,5 +1,23 @@ -KtFunctionalTypeVariableCall: -target = x: kotlin.Function2<@R|kotlin.ParameterName|(name = String(a)) kotlin.Int, @R|kotlin.ParameterName|(name = String(b)) kotlin.String, kotlin.Unit> -argumentMapping = { 1 -> (a: @R|kotlin.ParameterName|(name = String(a)) kotlin.Int), "" -> (b: @R|kotlin.ParameterName|(name = String(b)) kotlin.String) } -targetFunction = kotlin/Function2.invoke(: kotlin.Function2<@R|kotlin.ParameterName|(name = String(a)) kotlin.Int, @R|kotlin.ParameterName|(name = String(b)) kotlin.String, kotlin.Unit>, a: @R|kotlin.ParameterName|(name = String(a)) kotlin.Int, b: @R|kotlin.ParameterName|(name = String(b)) kotlin.String): kotlin.Unit -substitutor = +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(: kotlin.Function2<@R|kotlin.ParameterName|(name = String(a)) kotlin.Int, @R|kotlin.ParameterName|(name = String(b)) kotlin.String, kotlin.Unit>, a: @R|kotlin.ParameterName|(name = String(a)) kotlin.Int, b: @R|kotlin.ParameterName|(name = String(b)) kotlin.String): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = @R|kotlin.ParameterName|(name = String(a)) kotlin.Int + symbol = a: @R|kotlin.ParameterName|(name = String(a)) kotlin.Int, + KtVariableLikeSignature: + receiverType = null + returnType = @R|kotlin.ParameterName|(name = String(b)) kotlin.String + symbol = b: @R|kotlin.ParameterName|(name = String(b)) kotlin.String + ] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameGeneric.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameGeneric.txt index c698c9fe0b9..e71fafc5ef1 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameGeneric.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameGeneric.txt @@ -1,5 +1,19 @@ -KtFunctionalTypeVariableCall: -target = val x: kotlin.Function1<@R|kotlin.ParameterName|(name = String(a)) kotlin.Int, kotlin.Unit> -argumentMapping = { 1 -> (a: @R|kotlin.ParameterName|(name = String(a)) kotlin.Int) } -targetFunction = kotlin/Function1.invoke(: kotlin.Function1<@R|kotlin.ParameterName|(name = String(a)) kotlin.Int, kotlin.Unit>, a: @R|kotlin.ParameterName|(name = String(a)) kotlin.Int): kotlin.Unit -substitutor = +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(: kotlin.Function1<@R|kotlin.ParameterName|(name = String(a)) kotlin.Int, kotlin.Unit>, a: @R|kotlin.ParameterName|(name = String(a)) kotlin.Int): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = @R|kotlin.ParameterName|(name = String(a)) kotlin.Int + symbol = a: @R|kotlin.ParameterName|(name = String(a)) kotlin.Int + ] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameInNonFunctionType.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameInNonFunctionType.txt index fd64b33b4b7..a79bc9ad92e 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameInNonFunctionType.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameInNonFunctionType.txt @@ -1,4 +1,30 @@ -KtFunctionCall: -argumentMapping = { 1 -> (a: @R|kotlin.ParameterName|(name = String(notMe)) kotlin.Int), "" -> (b: @R|kotlin.ParameterName|(name = String(meNeither)) kotlin.String) } -targetFunction = /call(a: @R|kotlin.ParameterName|(name = String(notMe)) kotlin.Int, b: @R|kotlin.ParameterName|(name = String(meNeither)) kotlin.String): kotlin.Unit -substitutor = +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = false + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Unit + symbol = /call(a: @R|kotlin.ParameterName|(name = String(notMe)) kotlin.Int, b: @R|kotlin.ParameterName|(name = String(meNeither)) kotlin.String): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = @R|kotlin.ParameterName|(name = String(notMe)) kotlin.Int + symbol = a: @R|kotlin.ParameterName|(name = String(notMe)) kotlin.Int, + KtVariableLikeSignature: + receiverType = null + returnType = @R|kotlin.ParameterName|(name = String(meNeither)) kotlin.String + symbol = b: @R|kotlin.ParameterName|(name = String(meNeither)) kotlin.String + ] + argumentMapping = { + 1 -> (KtVariableLikeSignature: + receiverType = null + returnType = @R|kotlin.ParameterName|(name = String(notMe)) kotlin.Int + symbol = a: @R|kotlin.ParameterName|(name = String(notMe)) kotlin.Int), + "" -> (KtVariableLikeSignature: + receiverType = null + returnType = @R|kotlin.ParameterName|(name = String(meNeither)) kotlin.String + symbol = b: @R|kotlin.ParameterName|(name = String(meNeither)) kotlin.String) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameMixed.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameMixed.txt index 83e172f7f0a..29f3a1a9a05 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameMixed.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableAsFunctionWithParameterNameMixed.txt @@ -1,5 +1,28 @@ -KtFunctionalTypeVariableCall: -target = x: kotlin.Function2<@R|kotlin.ParameterName|(name = String(a)) kotlin.Int, kotlin.String, kotlin.Unit> -argumentMapping = { 1 -> (a: @R|kotlin.ParameterName|(name = String(a)) kotlin.Int), "" -> (p2: kotlin.String) } -targetFunction = kotlin/Function2.invoke(: kotlin.Function2<@R|kotlin.ParameterName|(name = String(a)) kotlin.Int, kotlin.String, kotlin.Unit>, a: @R|kotlin.ParameterName|(name = String(a)) kotlin.Int, p2: kotlin.String): kotlin.Unit -substitutor = +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(: kotlin.Function2<@R|kotlin.ParameterName|(name = String(a)) kotlin.Int, kotlin.String, kotlin.Unit>, a: @R|kotlin.ParameterName|(name = String(a)) kotlin.Int, p2: kotlin.String): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = @R|kotlin.ParameterName|(name = String(a)) kotlin.Int + symbol = a: @R|kotlin.ParameterName|(name = String(a)) kotlin.Int, + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = p2: kotlin.String + ] + argumentMapping = { + "" -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = p2: kotlin.String) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithExtensionInvoke.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithExtensionInvoke.txt index 3f7cbccf2d8..1f9bd2d4106 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithExtensionInvoke.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithExtensionInvoke.txt @@ -1,5 +1,24 @@ -KtVariableWithInvokeFunctionCall: -target = f: Foo -argumentMapping = { "" -> (t: kotlin.String) } -targetFunction = /invoke(: Foo, t: kotlin.String): kotlin.Unit -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = true + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = KtExplicitReceiverValue: + expression = f + isSafeNavigation = false + signature = KtFunctionLikeSignature: + receiverType = Foo + returnType = kotlin.Unit + symbol = /invoke(: Foo, t: T): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = t: T + ] + argumentMapping = { + "" -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = t: T) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithInvokeFunctionCall_dispatchReceiver.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithInvokeFunctionCall_dispatchReceiver.kt new file mode 100644 index 00000000000..4d399d07423 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithInvokeFunctionCall_dispatchReceiver.kt @@ -0,0 +1,7 @@ +operator fun Int.invoke() {} +class A { + val f: Int = 1 + fun test() { + f() + } +} diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithInvokeFunctionCall_dispatchReceiver.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithInvokeFunctionCall_dispatchReceiver.txt new file mode 100644 index 00000000000..a99ba3db83f --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithInvokeFunctionCall_dispatchReceiver.txt @@ -0,0 +1,14 @@ +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = true + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = KtExplicitReceiverValue: + expression = f + isSafeNavigation = false + signature = KtFunctionLikeSignature: + receiverType = kotlin.Int + returnType = kotlin.Unit + symbol = /invoke(: kotlin.Int): kotlin.Unit + valueParameters = [] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithInvokeFunctionCall_extensionReceiver.kt b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithInvokeFunctionCall_extensionReceiver.kt new file mode 100644 index 00000000000..ffc317bf919 --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithInvokeFunctionCall_extensionReceiver.kt @@ -0,0 +1,8 @@ +operator fun Int.invoke() {} +class A { + fun test() { + f() + } +} + +val A.f: Int = 1 diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithInvokeFunctionCall_extensionReceiver.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithInvokeFunctionCall_extensionReceiver.txt new file mode 100644 index 00000000000..a99ba3db83f --- /dev/null +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithInvokeFunctionCall_extensionReceiver.txt @@ -0,0 +1,14 @@ +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = true + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = null + extensionReceiver = KtExplicitReceiverValue: + expression = f + isSafeNavigation = false + signature = KtFunctionLikeSignature: + receiverType = kotlin.Int + returnType = kotlin.Unit + symbol = /invoke(: kotlin.Int): kotlin.Unit + valueParameters = [] + argumentMapping = {} \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithMemberInvoke.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithMemberInvoke.txt index 4544b64c82c..efe4e30ea55 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithMemberInvoke.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/variableWithMemberInvoke.txt @@ -1,5 +1,24 @@ -KtVariableWithInvokeFunctionCall: -target = f: Foo -argumentMapping = { "" -> (t: kotlin.String) } -targetFunction = /Foo.invoke(: Foo, t: kotlin.String): kotlin.Unit -substitutor = \ No newline at end of file +KtSuccessCallInfo: + call = KtSimpleFunctionCall: + isImplicitInvoke = true + partiallyAppliedSymbol = KtPartiallyAppliedSymbol: + dispatchReceiver = KtExplicitReceiverValue: + expression = f + isSafeNavigation = false + extensionReceiver = null + signature = KtFunctionLikeSignature: + receiverType = null + returnType = kotlin.Unit + symbol = /Foo.invoke(: Foo, t: T): kotlin.Unit + valueParameters = [ + KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = t: T + ] + argumentMapping = { + "" -> (KtVariableLikeSignature: + receiverType = null + returnType = kotlin.String + symbol = t: T) + } \ No newline at end of file diff --git a/analysis/analysis-api/testData/scopes/delegatedMemberScope/simple.txt b/analysis/analysis-api/testData/scopes/delegatedMemberScope/simple.txt index a229636dad0..0159a182f79 100644 --- a/analysis/analysis-api/testData/scopes/delegatedMemberScope/simple.txt +++ b/analysis/analysis-api/testData/scopes/delegatedMemberScope/simple.txt @@ -2,6 +2,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /I.foo hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/scopes/delegatedMemberScope/withOverridden.txt b/analysis/analysis-api/testData/scopes/delegatedMemberScope/withOverridden.txt index 0cdd1a7f210..6071d9518d8 100644 --- a/analysis/analysis-api/testData/scopes/delegatedMemberScope/withOverridden.txt +++ b/analysis/analysis-api/testData/scopes/delegatedMemberScope/withOverridden.txt @@ -2,6 +2,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /I2.bar hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/scopes/fileScopeTest/simpleFileScope.txt b/analysis/analysis-api/testData/scopes/fileScopeTest/simpleFileScope.txt index fed0b4bbf31..640ef804750 100644 --- a/analysis/analysis-api/testData/scopes/fileScopeTest/simpleFileScope.txt +++ b/analysis/analysis-api/testData/scopes/fileScopeTest/simpleFileScope.txt @@ -12,6 +12,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /test hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/scopes/memberScopeByFqName/Int.txt b/analysis/analysis-api/testData/scopes/memberScopeByFqName/Int.txt index 80f3e288970..6e063413d13 100644 --- a/analysis/analysis-api/testData/scopes/memberScopeByFqName/Int.txt +++ b/analysis/analysis-api/testData/scopes/memberScopeByFqName/Int.txt @@ -2,6 +2,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.and hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: true @@ -28,6 +29,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.compareTo hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -54,6 +56,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.compareTo hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -80,6 +83,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.compareTo hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -106,6 +110,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.compareTo hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -132,6 +137,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.compareTo hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -158,6 +164,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.compareTo hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -184,6 +191,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.dec hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -208,6 +216,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.div hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -234,6 +243,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.div hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -260,6 +270,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.div hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -286,6 +297,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.div hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -312,6 +324,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.div hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -338,6 +351,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.div hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -364,6 +378,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.inc hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -388,6 +403,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.inv hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -412,6 +428,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.minus hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -438,6 +455,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.minus hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -464,6 +482,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.minus hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -490,6 +509,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.minus hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -516,6 +536,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.minus hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -542,6 +563,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.minus hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -568,6 +590,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.or hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: true @@ -594,6 +617,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.plus hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -620,6 +644,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.plus hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -646,6 +671,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.plus hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -672,6 +698,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.plus hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -698,6 +725,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.plus hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -724,6 +752,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.plus hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -750,6 +779,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.rangeTo hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -776,6 +806,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.rangeTo hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -802,6 +833,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.rangeTo hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -828,6 +860,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.rangeTo hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -857,6 +890,7 @@ KtFunctionSymbol: ] callableIdIfNonLocal: kotlin/Int.rem hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -886,6 +920,7 @@ KtFunctionSymbol: ] callableIdIfNonLocal: kotlin/Int.rem hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -915,6 +950,7 @@ KtFunctionSymbol: ] callableIdIfNonLocal: kotlin/Int.rem hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -944,6 +980,7 @@ KtFunctionSymbol: ] callableIdIfNonLocal: kotlin/Int.rem hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -973,6 +1010,7 @@ KtFunctionSymbol: ] callableIdIfNonLocal: kotlin/Int.rem hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1002,6 +1040,7 @@ KtFunctionSymbol: ] callableIdIfNonLocal: kotlin/Int.rem hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1028,6 +1067,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.shl hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: true @@ -1054,6 +1094,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.shr hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: true @@ -1080,6 +1121,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.times hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1106,6 +1148,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.times hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1132,6 +1175,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.times hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1158,6 +1202,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.times hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1184,6 +1229,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.times hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1210,6 +1256,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.times hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1236,6 +1283,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.toByte hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1260,6 +1308,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.toChar hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1284,6 +1333,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.toDouble hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1308,6 +1358,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.toFloat hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1332,6 +1383,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.toInt hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1356,6 +1408,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.toLong hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1380,6 +1433,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.toShort hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1404,6 +1458,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.unaryMinus hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1428,6 +1483,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.unaryPlus hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1452,6 +1508,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.ushr hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: true @@ -1478,6 +1535,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Int.xor hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: true @@ -1504,6 +1562,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Any.equals hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1530,6 +1589,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Any.hashCode hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1554,6 +1614,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Any.toString hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/scopes/memberScopeByFqName/MutableList.txt b/analysis/analysis-api/testData/scopes/memberScopeByFqName/MutableList.txt index 99467effade..d3e94a0a2f9 100644 --- a/analysis/analysis-api/testData/scopes/memberScopeByFqName/MutableList.txt +++ b/analysis/analysis-api/testData/scopes/memberScopeByFqName/MutableList.txt @@ -2,6 +2,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/MutableList.add hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -28,6 +29,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/MutableList.add hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -55,6 +57,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/MutableList.addAll hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -82,6 +85,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/MutableList.addAll hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -108,6 +112,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/MutableList.clear hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -132,6 +137,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/MutableList.listIterator hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -156,6 +162,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/MutableList.listIterator hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -182,6 +189,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/MutableList.remove hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -208,6 +216,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/MutableList.removeAll hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -234,6 +243,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/MutableList.removeAt hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -260,6 +270,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/MutableList.retainAll hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -286,6 +297,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/MutableList.set hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -313,6 +325,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/MutableList.subList hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -340,6 +353,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/MutableList.contains hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -366,6 +380,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/MutableList.containsAll hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -392,6 +407,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/MutableList.get hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -418,6 +434,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/MutableList.indexOf hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -444,6 +461,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/List.isEmpty hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -468,6 +486,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/MutableList.iterator hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -492,6 +511,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/MutableList.lastIndexOf hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -550,6 +570,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Any.equals hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -576,6 +597,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Any.hashCode hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -600,6 +622,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Any.toString hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/scopes/memberScopeByFqName/java.lang.String.txt b/analysis/analysis-api/testData/scopes/memberScopeByFqName/java.lang.String.txt index d89c5a0f22b..d145d77d718 100644 --- a/analysis/analysis-api/testData/scopes/memberScopeByFqName/java.lang.String.txt +++ b/analysis/analysis-api/testData/scopes/memberScopeByFqName/java.lang.String.txt @@ -32,6 +32,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.hash32 hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -103,6 +104,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.isEmpty hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -127,6 +129,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.codePointAt hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -153,6 +156,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.codePointBefore hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -179,6 +183,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.codePointCount hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -206,6 +211,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.offsetByCodePoints hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -233,6 +239,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.getChars hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -260,6 +267,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.getChars hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -292,6 +300,7 @@ KtFunctionSymbol: ] callableIdIfNonLocal: java/lang/String.getBytes hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -321,6 +330,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.getBytes hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -347,6 +357,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.getBytes hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -373,6 +384,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.getBytes hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -397,6 +409,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.equals hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -423,6 +436,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.contentEquals hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -449,6 +463,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.contentEquals hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -475,6 +490,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.equalsIgnoreCase hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -501,6 +517,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.compareTo hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -527,6 +544,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.compareToIgnoreCase hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -553,6 +571,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.regionMatches hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -582,6 +601,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.regionMatches hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -612,6 +632,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.startsWith hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -639,6 +660,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.startsWith hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -665,6 +687,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.endsWith hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -691,6 +714,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.hashCode hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -715,6 +739,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.indexOf hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -741,6 +766,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.indexOf hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -768,6 +794,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.indexOf hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -794,6 +821,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.indexOf hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -821,6 +849,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.indexOfSupplementary hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -848,6 +877,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.lastIndexOf hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -874,6 +904,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.lastIndexOf hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -901,6 +932,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.lastIndexOf hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -927,6 +959,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.lastIndexOf hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -954,6 +987,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.lastIndexOfSupplementary hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -981,6 +1015,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.substring hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1007,6 +1042,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.substring hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1034,6 +1070,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.subSequence hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1061,6 +1098,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.concat hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1087,6 +1125,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.replace hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1114,6 +1153,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.replace hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1141,6 +1181,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.matches hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1167,6 +1208,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.contains hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1193,6 +1235,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.replaceFirst hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1220,6 +1263,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.replaceAll hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1247,6 +1291,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.split hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1274,6 +1319,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.split hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1300,6 +1346,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.toLowerCase hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1326,6 +1373,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.toLowerCase hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1350,6 +1398,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.toUpperCase hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1376,6 +1425,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.toUpperCase hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1400,6 +1450,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.trim hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1424,6 +1475,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.toString hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1448,6 +1500,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.toCharArray hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1472,6 +1525,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.intern hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -1496,6 +1550,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: java/lang/String.get hasStableParameterNames: false + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/scopes/memberScopeByFqName/kotlin.Function2.txt b/analysis/analysis-api/testData/scopes/memberScopeByFqName/kotlin.Function2.txt index a7f6e0a72c1..685d7316b6d 100644 --- a/analysis/analysis-api/testData/scopes/memberScopeByFqName/kotlin.Function2.txt +++ b/analysis/analysis-api/testData/scopes/memberScopeByFqName/kotlin.Function2.txt @@ -2,6 +2,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Function2.invoke hasStableParameterNames: false + isBuiltinFunctionInvoke: true isExtension: false isExternal: false isInfix: false @@ -29,6 +30,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Any.equals hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -55,6 +57,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Any.hashCode hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -79,6 +82,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Any.toString hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/scopes/memberScopeByFqName/overridenFunctionWithGenericBound.txt b/analysis/analysis-api/testData/scopes/memberScopeByFqName/overridenFunctionWithGenericBound.txt index f9ef8a6e6af..e7c3551b6f5 100644 --- a/analysis/analysis-api/testData/scopes/memberScopeByFqName/overridenFunctionWithGenericBound.txt +++ b/analysis/analysis-api/testData/scopes/memberScopeByFqName/overridenFunctionWithGenericBound.txt @@ -2,6 +2,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: test/MyClass.funWithOuterAndOwnGenericsAndBounds hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -67,6 +68,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Any.equals hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -93,6 +95,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Any.hashCode hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -117,6 +120,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/Any.toString hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/symbols/symbolByFqName/fileWalkDirectionEnum.txt b/analysis/analysis-api/testData/symbols/symbolByFqName/fileWalkDirectionEnum.txt index 8a10dcaa4c1..da44a0b8d36 100644 --- a/analysis/analysis-api/testData/symbols/symbolByFqName/fileWalkDirectionEnum.txt +++ b/analysis/analysis-api/testData/symbols/symbolByFqName/fileWalkDirectionEnum.txt @@ -2,6 +2,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/listOf hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -32,6 +33,7 @@ KtFunctionSymbol: ] callableIdIfNonLocal: kotlin/collections/listOf hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -57,6 +59,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/listOf hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/symbols/symbolByFqName/memberFunction.txt b/analysis/analysis-api/testData/symbols/symbolByFqName/memberFunction.txt index 146218313c4..fe2827061ec 100644 --- a/analysis/analysis-api/testData/symbols/symbolByFqName/memberFunction.txt +++ b/analysis/analysis-api/testData/symbols/symbolByFqName/memberFunction.txt @@ -2,6 +2,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/List.get hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/symbols/symbolByFqName/memberFunctionWithOverloads.txt b/analysis/analysis-api/testData/symbols/symbolByFqName/memberFunctionWithOverloads.txt index abfad33b3ec..9e4b5177578 100644 --- a/analysis/analysis-api/testData/symbols/symbolByFqName/memberFunctionWithOverloads.txt +++ b/analysis/analysis-api/testData/symbols/symbolByFqName/memberFunctionWithOverloads.txt @@ -2,6 +2,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/List.listIterator hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -26,6 +27,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: kotlin/collections/List.listIterator hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/symbols/symbolByPsi/annotations.txt b/analysis/analysis-api/testData/symbols/symbolByPsi/annotations.txt index 6a08be05dc1..336a60ff91b 100644 --- a/analysis/analysis-api/testData/symbols/symbolByPsi/annotations.txt +++ b/analysis/analysis-api/testData/symbols/symbolByPsi/annotations.txt @@ -71,6 +71,7 @@ KtFunctionSymbol: ] callableIdIfNonLocal: /X.x hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/symbols/symbolByPsi/anonymousObject.txt b/analysis/analysis-api/testData/symbols/symbolByPsi/anonymousObject.txt index b084f1c9e24..65e306c36e5 100644 --- a/analysis/analysis-api/testData/symbols/symbolByPsi/anonymousObject.txt +++ b/analysis/analysis-api/testData/symbols/symbolByPsi/anonymousObject.txt @@ -2,6 +2,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: null hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/symbols/symbolByPsi/classMembes.txt b/analysis/analysis-api/testData/symbols/symbolByPsi/classMembes.txt index 0b1a5d2700d..7a14c719a19 100644 --- a/analysis/analysis-api/testData/symbols/symbolByPsi/classMembes.txt +++ b/analysis/analysis-api/testData/symbols/symbolByPsi/classMembes.txt @@ -34,6 +34,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /A.x hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/symbols/symbolByPsi/deprecated.txt b/analysis/analysis-api/testData/symbols/symbolByPsi/deprecated.txt index cd29a2cbc60..2f88ac62b7e 100644 --- a/analysis/analysis-api/testData/symbols/symbolByPsi/deprecated.txt +++ b/analysis/analysis-api/testData/symbols/symbolByPsi/deprecated.txt @@ -132,6 +132,7 @@ KtFunctionSymbol: ] callableIdIfNonLocal: /f hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -217,6 +218,7 @@ KtFunctionSymbol: ] callableIdIfNonLocal: /Foo.f2 hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/symbols/symbolByPsi/extensionFunction.txt b/analysis/analysis-api/testData/symbols/symbolByPsi/extensionFunction.txt index d4898a3df4d..15529e9761c 100644 --- a/analysis/analysis-api/testData/symbols/symbolByPsi/extensionFunction.txt +++ b/analysis/analysis-api/testData/symbols/symbolByPsi/extensionFunction.txt @@ -2,6 +2,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /foo hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: true isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/symbols/symbolByPsi/forLoopVariable.txt b/analysis/analysis-api/testData/symbols/symbolByPsi/forLoopVariable.txt index 858c12ab865..5f3148859d4 100644 --- a/analysis/analysis-api/testData/symbols/symbolByPsi/forLoopVariable.txt +++ b/analysis/analysis-api/testData/symbols/symbolByPsi/forLoopVariable.txt @@ -13,6 +13,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /usage hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/symbols/symbolByPsi/function.txt b/analysis/analysis-api/testData/symbols/symbolByPsi/function.txt index 3d643120cd9..bcc362953e6 100644 --- a/analysis/analysis-api/testData/symbols/symbolByPsi/function.txt +++ b/analysis/analysis-api/testData/symbols/symbolByPsi/function.txt @@ -15,6 +15,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /foo hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/symbols/symbolByPsi/functionWithTypeParams.txt b/analysis/analysis-api/testData/symbols/symbolByPsi/functionWithTypeParams.txt index 5ebd6976636..35e7586b794 100644 --- a/analysis/analysis-api/testData/symbols/symbolByPsi/functionWithTypeParams.txt +++ b/analysis/analysis-api/testData/symbols/symbolByPsi/functionWithTypeParams.txt @@ -25,6 +25,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /foo hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/symbols/symbolByPsi/implicitReturn.txt b/analysis/analysis-api/testData/symbols/symbolByPsi/implicitReturn.txt index 3ba83fb8acc..1ffcdbc9109 100644 --- a/analysis/analysis-api/testData/symbols/symbolByPsi/implicitReturn.txt +++ b/analysis/analysis-api/testData/symbols/symbolByPsi/implicitReturn.txt @@ -2,6 +2,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /foo hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/symbols/symbolByPsi/implicitReturnInLambda.txt b/analysis/analysis-api/testData/symbols/symbolByPsi/implicitReturnInLambda.txt index bfe1e0acdd1..204e4e788a5 100644 --- a/analysis/analysis-api/testData/symbols/symbolByPsi/implicitReturnInLambda.txt +++ b/analysis/analysis-api/testData/symbols/symbolByPsi/implicitReturnInLambda.txt @@ -122,6 +122,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /foo hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -158,6 +159,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /bar hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/symbols/symbolByPsi/localDeclarations.txt b/analysis/analysis-api/testData/symbols/symbolByPsi/localDeclarations.txt index cb340ffa83b..3a5d024d4a2 100644 --- a/analysis/analysis-api/testData/symbols/symbolByPsi/localDeclarations.txt +++ b/analysis/analysis-api/testData/symbols/symbolByPsi/localDeclarations.txt @@ -13,6 +13,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: null hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -57,6 +58,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /yyy hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/symbols/symbolByPsi/memberFunctions.txt b/analysis/analysis-api/testData/symbols/symbolByPsi/memberFunctions.txt index cb69be5a9f2..b56bb4e40d0 100644 --- a/analysis/analysis-api/testData/symbols/symbolByPsi/memberFunctions.txt +++ b/analysis/analysis-api/testData/symbols/symbolByPsi/memberFunctions.txt @@ -2,6 +2,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /A.x hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -26,6 +27,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /A.y hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/symbols/symbolByPsi/outerAndInnerClasses.txt b/analysis/analysis-api/testData/symbols/symbolByPsi/outerAndInnerClasses.txt index ee84c22ca71..63eac2c2ab7 100644 --- a/analysis/analysis-api/testData/symbols/symbolByPsi/outerAndInnerClasses.txt +++ b/analysis/analysis-api/testData/symbols/symbolByPsi/outerAndInnerClasses.txt @@ -187,6 +187,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /X.foo hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/symbols/symbolByPsi/topLevelFunctions.txt b/analysis/analysis-api/testData/symbols/symbolByPsi/topLevelFunctions.txt index 9f3c0381ff2..0e23e4879b2 100644 --- a/analysis/analysis-api/testData/symbols/symbolByPsi/topLevelFunctions.txt +++ b/analysis/analysis-api/testData/symbols/symbolByPsi/topLevelFunctions.txt @@ -2,6 +2,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /x hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -25,6 +26,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /y hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/symbols/symbolByPsi/typeAnnotations.txt b/analysis/analysis-api/testData/symbols/symbolByPsi/typeAnnotations.txt index 0b7e0a8d869..e24f7a220cc 100644 --- a/analysis/analysis-api/testData/symbols/symbolByPsi/typeAnnotations.txt +++ b/analysis/analysis-api/testData/symbols/symbolByPsi/typeAnnotations.txt @@ -135,6 +135,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /X.f hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/symbols/symbolByPsi/varargFunctions.txt b/analysis/analysis-api/testData/symbols/symbolByPsi/varargFunctions.txt index 81744716e88..63446bc52d4 100644 --- a/analysis/analysis-api/testData/symbols/symbolByPsi/varargFunctions.txt +++ b/analysis/analysis-api/testData/symbols/symbolByPsi/varargFunctions.txt @@ -15,6 +15,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /primitive hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -53,6 +54,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /nullablePrimitive hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -91,6 +93,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /nonPrimitive hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false @@ -129,6 +132,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: /error hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/symbols/symbolByReference/genericFromFunctionInLocalClass.txt b/analysis/analysis-api/testData/symbols/symbolByReference/genericFromFunctionInLocalClass.txt index 5d6c9f3dabf..366a199e4f3 100644 --- a/analysis/analysis-api/testData/symbols/symbolByReference/genericFromFunctionInLocalClass.txt +++ b/analysis/analysis-api/testData/symbols/symbolByReference/genericFromFunctionInLocalClass.txt @@ -2,6 +2,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: null hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false diff --git a/analysis/analysis-api/testData/symbols/symbolByReference/genericFromOuterClassInInnerClass.txt b/analysis/analysis-api/testData/symbols/symbolByReference/genericFromOuterClassInInnerClass.txt index 61307716347..f4092ae8466 100644 --- a/analysis/analysis-api/testData/symbols/symbolByReference/genericFromOuterClassInInnerClass.txt +++ b/analysis/analysis-api/testData/symbols/symbolByReference/genericFromOuterClassInInnerClass.txt @@ -2,6 +2,7 @@ KtFunctionSymbol: annotationsList: [] callableIdIfNonLocal: test/TopLevel.Base.withOuter hasStableParameterNames: true + isBuiltinFunctionInvoke: false isExtension: false isExternal: false isInfix: false