FIR Analysis API: reimplement KtFirCallResolver with new data model
This commit is contained in:
committed by
Ilya Kirillov
parent
c9f9ce99c1
commit
9b05019137
+222
@@ -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 {
|
||||
|
||||
+28
-7
@@ -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<FirTypeParameterSymbol, ConeKotlinType>()
|
||||
for (i in typeArguments.indices) {
|
||||
val type = typeArguments[i].safeAs<FirTypeProjectionWithVariance>()?.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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+676
-260
File diff suppressed because it is too large
Load Diff
+3
-1
@@ -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 }
|
||||
}
|
||||
|
||||
+252
@@ -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 {
|
||||
|
||||
+36
-9
@@ -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<KtSafeQualifiedExpression>() ?: return false
|
||||
return KtPsiUtil.deparenthesize(safeQualifiedExpression.receiverExpression) == KtPsiUtil.deparenthesize(this)
|
||||
}
|
||||
|
||||
protected companion object {
|
||||
val nonCallBinaryOperator = setOf(KtTokens.ELVIS, KtTokens.EQEQEQ, KtTokens.EXCLEQEQEQ)
|
||||
}
|
||||
}
|
||||
+79
-67
@@ -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<KtFile>, 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 -> "<constructor>"
|
||||
is KtPropertyGetterSymbol -> callableIdIfNonLocal ?: "<getter>"
|
||||
is KtPropertySetterSymbol -> callableIdIfNonLocal ?: "<setter>"
|
||||
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 -> "<constructor>"
|
||||
is KtPropertyGetterSymbol -> callableIdIfNonLocal ?: "<getter>"
|
||||
is KtPropertySetterSymbol -> callableIdIfNonLocal ?: "<setter>"
|
||||
else -> error("unexpected symbol kind in KtCall: ${this@stringValue::class.java}")
|
||||
}
|
||||
)
|
||||
append("(")
|
||||
(this@stringValue as? KtFunctionSymbol)?.receiverType?.let { receiver ->
|
||||
append("<extension receiver>: ${receiver.render()}")
|
||||
if (valueParameters.isNotEmpty()) append(", ")
|
||||
}
|
||||
)
|
||||
append("(")
|
||||
(this@stringValue as? KtFunctionSymbol)?.receiverType?.let { receiver ->
|
||||
append("<extension receiver>: ${receiver.render()}")
|
||||
if (valueParameters.isNotEmpty()) append(", ")
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
(this@stringValue as? KtCallableSymbol)?.getDispatchReceiverType()?.let { dispatchReceiverType ->
|
||||
append("<dispatch receiver>: ${dispatchReceiverType.render()}")
|
||||
if (valueParameters.isNotEmpty()) append(", ")
|
||||
@Suppress("DEPRECATION")
|
||||
(this@stringValue as? KtCallableSymbol)?.getDispatchReceiverType()?.let { dispatchReceiverType ->
|
||||
append("<dispatch receiver>: ${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 -> "<empty substitutor>"
|
||||
is KtMapBackedSubstitutor -> {
|
||||
val mappingText = getAsMap().entries
|
||||
.joinToString(prefix = "{", postfix = "}") { (k, v) -> k.stringValue() + " = " + v.asStringForDebugging() }
|
||||
"<map substitutor: $mappingText>"
|
||||
}
|
||||
is KtSubstitutor -> "<complex substitutor>"
|
||||
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<Any, *>).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 -> "<empty substitutor>"
|
||||
is KtMapBackedSubstitutor -> {
|
||||
val mappingText = getAsMap().orEmpty().entries
|
||||
.joinToString(prefix = "{", postfix = "}") { (k, v) -> k.stringValue() + " = " + v.asStringForDebugging() }
|
||||
"<map substitutor: $mappingText>"
|
||||
}
|
||||
is KtSubstitutor -> "<complex substitutor>"
|
||||
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()
|
||||
}
|
||||
|
||||
|
||||
+1
-4
@@ -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")
|
||||
|
||||
|
||||
+21
-3
@@ -1,3 +1,21 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { Annotation("v1", "v2") -> (value: Annotation) }
|
||||
targetFunction = <constructor>(value: Annotation): AnnotationInner
|
||||
KtSuccessCallInfo:
|
||||
call = KtAnnotationCall:
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = AnnotationInner
|
||||
symbol = <constructor>(value: Annotation): AnnotationInner
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = Annotation
|
||||
symbol = value: Annotation
|
||||
]
|
||||
argumentMapping = {
|
||||
Annotation("v1", "v2") -> (KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = Annotation
|
||||
symbol = value: Annotation)
|
||||
}
|
||||
+22
-4
@@ -1,4 +1,22 @@
|
||||
KtFunctionCall:
|
||||
argumentMapping = { arrayOf("v1", "v2") -> (vararg strings: kotlin.String) }
|
||||
targetFunction = <constructor>(vararg strings: kotlin.String): Annotation
|
||||
substitutor = <empty substitutor>
|
||||
KtSuccessCallInfo:
|
||||
call = KtSimpleFunctionCall:
|
||||
isImplicitInvoke = false
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = Annotation
|
||||
symbol = <constructor>(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)
|
||||
}
|
||||
+22
-4
@@ -1,4 +1,22 @@
|
||||
KtFunctionCall:
|
||||
argumentMapping = { ["v1", "v2"] -> (vararg strings: kotlin.String) }
|
||||
targetFunction = <constructor>(vararg strings: kotlin.String): Annotation
|
||||
substitutor = <empty substitutor>
|
||||
KtSuccessCallInfo:
|
||||
call = KtSimpleFunctionCall:
|
||||
isImplicitInvoke = false
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = Annotation
|
||||
symbol = <constructor>(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)
|
||||
}
|
||||
+26
-4
@@ -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<Annotation>
|
||||
substitutor = <map substitutor: {T = Annotation}>
|
||||
KtSuccessCallInfo:
|
||||
call = KtSimpleFunctionCall:
|
||||
isImplicitInvoke = false
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Array<Annotation>
|
||||
symbol = kotlin/arrayOf(vararg elements: T): kotlin.Array<T>
|
||||
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)
|
||||
}
|
||||
+21
-3
@@ -1,3 +1,21 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { [Annotation("v1", "v2"), Annotation(["v3", "v4"])] -> (vararg annos: Annotation) }
|
||||
targetFunction = <constructor>(vararg annos: Annotation): AnnotationArray
|
||||
KtSuccessCallInfo:
|
||||
call = KtAnnotationCall:
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = AnnotationArray
|
||||
symbol = <constructor>(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)
|
||||
}
|
||||
Vendored
+17
-4
@@ -1,4 +1,17 @@
|
||||
KtFunctionCall:
|
||||
argumentMapping = { }
|
||||
targetFunction = <constructor>(vararg strings: kotlin.String): Annotation
|
||||
substitutor = <empty substitutor>
|
||||
KtSuccessCallInfo:
|
||||
call = KtSimpleFunctionCall:
|
||||
isImplicitInvoke = false
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = Annotation
|
||||
symbol = <constructor>(vararg strings: kotlin.String): Annotation
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.String
|
||||
symbol = vararg strings: kotlin.String
|
||||
]
|
||||
argumentMapping = {}
|
||||
analysis/analysis-api/testData/components/callResolver/resolveCall/annotationInAnnotation_vararg.txt
Vendored
+26
-4
@@ -1,4 +1,26 @@
|
||||
KtFunctionCall:
|
||||
argumentMapping = { "v1" -> (vararg strings: kotlin.String), "v2" -> (vararg strings: kotlin.String) }
|
||||
targetFunction = <constructor>(vararg strings: kotlin.String): Annotation
|
||||
substitutor = <empty substitutor>
|
||||
KtSuccessCallInfo:
|
||||
call = KtSimpleFunctionCall:
|
||||
isImplicitInvoke = false
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = Annotation
|
||||
symbol = <constructor>(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)
|
||||
}
|
||||
Vendored
+16
-3
@@ -1,3 +1,16 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { }
|
||||
targetFunction = <constructor>(vararg names: kotlin.String): kotlin.Suppress
|
||||
KtSuccessCallInfo:
|
||||
call = KtAnnotationCall:
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Suppress
|
||||
symbol = <constructor>(vararg names: kotlin.String): kotlin.Suppress
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.String
|
||||
symbol = vararg names: kotlin.String
|
||||
]
|
||||
argumentMapping = {}
|
||||
Vendored
+21
-3
@@ -1,3 +1,21 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { "UNCHECKED_CAST" -> (vararg names: kotlin.String) }
|
||||
targetFunction = <constructor>(vararg names: kotlin.String): kotlin.Suppress
|
||||
KtSuccessCallInfo:
|
||||
call = KtAnnotationCall:
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Suppress
|
||||
symbol = <constructor>(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)
|
||||
}
|
||||
+21
-3
@@ -1,3 +1,21 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { "UNCHECKED_CAST" -> (vararg names: kotlin.String) }
|
||||
targetFunction = <constructor>(vararg names: kotlin.String): kotlin.Suppress
|
||||
KtSuccessCallInfo:
|
||||
call = KtAnnotationCall:
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Suppress
|
||||
symbol = <constructor>(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)
|
||||
}
|
||||
Vendored
+16
-3
@@ -1,3 +1,16 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { }
|
||||
targetFunction = <constructor>(vararg names: kotlin.String): kotlin.Suppress
|
||||
KtSuccessCallInfo:
|
||||
call = KtAnnotationCall:
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Suppress
|
||||
symbol = <constructor>(vararg names: kotlin.String): kotlin.Suppress
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.String
|
||||
symbol = vararg names: kotlin.String
|
||||
]
|
||||
argumentMapping = {}
|
||||
+21
-3
@@ -1,3 +1,21 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { "DEPRECATION" -> (vararg names: kotlin.String) }
|
||||
targetFunction = <constructor>(vararg names: kotlin.String): kotlin.Suppress
|
||||
KtSuccessCallInfo:
|
||||
call = KtAnnotationCall:
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Suppress
|
||||
symbol = <constructor>(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)
|
||||
}
|
||||
+21
-3
@@ -1,3 +1,21 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { "Foo" -> (name: kotlin.String) }
|
||||
targetFunction = <constructor>(name: kotlin.String): kotlin.jvm.JvmName
|
||||
KtSuccessCallInfo:
|
||||
call = KtAnnotationCall:
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.jvm.JvmName
|
||||
symbol = <constructor>(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)
|
||||
}
|
||||
Vendored
+11
-3
@@ -1,3 +1,11 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { }
|
||||
targetFunction = <constructor>(): Anno
|
||||
KtSuccessCallInfo:
|
||||
call = KtAnnotationCall:
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = Anno
|
||||
symbol = <constructor>(): Anno
|
||||
valueParameters = []
|
||||
argumentMapping = {}
|
||||
+11
-3
@@ -1,3 +1,11 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { }
|
||||
targetFunction = <constructor>(): Anno
|
||||
KtSuccessCallInfo:
|
||||
call = KtAnnotationCall:
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = Anno
|
||||
symbol = <constructor>(): Anno
|
||||
valueParameters = []
|
||||
argumentMapping = {}
|
||||
analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnParameter_reified.txt
Vendored
+21
-3
@@ -1,3 +1,21 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { "s" -> (vararg names: kotlin.String) }
|
||||
targetFunction = <constructor>(vararg names: kotlin.String): kotlin.Suppress
|
||||
KtSuccessCallInfo:
|
||||
call = KtAnnotationCall:
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Suppress
|
||||
symbol = <constructor>(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)
|
||||
}
|
||||
+11
-3
@@ -1,3 +1,11 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { }
|
||||
targetFunction = <constructor>(): Anno
|
||||
KtSuccessCallInfo:
|
||||
call = KtAnnotationCall:
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = Anno
|
||||
symbol = <constructor>(): Anno
|
||||
valueParameters = []
|
||||
argumentMapping = {}
|
||||
Vendored
+11
-3
@@ -1,3 +1,11 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { }
|
||||
targetFunction = <constructor>(): Anno
|
||||
KtSuccessCallInfo:
|
||||
call = KtAnnotationCall:
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = Anno
|
||||
symbol = <constructor>(): Anno
|
||||
valueParameters = []
|
||||
argumentMapping = {}
|
||||
Vendored
+11
-3
@@ -1,3 +1,11 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { }
|
||||
targetFunction = <constructor>(): Anno
|
||||
KtSuccessCallInfo:
|
||||
call = KtAnnotationCall:
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = Anno
|
||||
symbol = <constructor>(): Anno
|
||||
valueParameters = []
|
||||
argumentMapping = {}
|
||||
analysis/analysis-api/testData/components/callResolver/resolveCall/annotationOnProperty_property.txt
Vendored
+11
-3
@@ -1,3 +1,11 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { }
|
||||
targetFunction = <constructor>(): Anno
|
||||
KtSuccessCallInfo:
|
||||
call = KtAnnotationCall:
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = Anno
|
||||
symbol = <constructor>(): Anno
|
||||
valueParameters = []
|
||||
argumentMapping = {}
|
||||
Vendored
+11
-3
@@ -1,3 +1,11 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { }
|
||||
targetFunction = <constructor>(): Anno
|
||||
KtSuccessCallInfo:
|
||||
call = KtAnnotationCall:
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = Anno
|
||||
symbol = <constructor>(): Anno
|
||||
valueParameters = []
|
||||
argumentMapping = {}
|
||||
Vendored
+11
-3
@@ -1,3 +1,11 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { }
|
||||
targetFunction = <constructor>(): Anno
|
||||
KtSuccessCallInfo:
|
||||
call = KtAnnotationCall:
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = Anno
|
||||
symbol = <constructor>(): Anno
|
||||
valueParameters = []
|
||||
argumentMapping = {}
|
||||
+30
-4
@@ -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<kotlin.Int>
|
||||
substitutor = <map substitutor: {T = kotlin/Int}>
|
||||
KtSuccessCallInfo:
|
||||
call = KtSimpleFunctionCall:
|
||||
isImplicitInvoke = false
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Array<kotlin.Int>
|
||||
symbol = kotlin/arrayOf(vararg elements: T): kotlin.Array<T>
|
||||
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)
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun test(f: () -> Unit) {
|
||||
<expr>f</expr>()
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
KtSuccessCallInfo:
|
||||
call = KtSimpleVariableAccessCall:
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Function0<kotlin.Unit>
|
||||
symbol = f: kotlin.Function0<kotlin.Unit>
|
||||
simpleAccess = Read:
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun test(a: Any?) {
|
||||
<expr>a!!</expr>
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
KtSuccessCallInfo:
|
||||
call = KtCheckNotNullCall:
|
||||
baseExpression = a
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
fun test(a: (() -> Unit)?) {
|
||||
<expr>a!!</expr>()
|
||||
}
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
KtSuccessCallInfo:
|
||||
call = KtCheckNotNullCall:
|
||||
baseExpression = a
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun test(i: Int, j: Int) {
|
||||
<expr>i < j</expr>
|
||||
}
|
||||
+24
@@ -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(<dispatch receiver>: 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)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
interface A {
|
||||
operator fun plusAssign(i: Int)
|
||||
}
|
||||
fun test(l: A) {
|
||||
<expr>l += 1</expr>
|
||||
}
|
||||
+24
@@ -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(<dispatch receiver>: 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)
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
interface A {
|
||||
operator fun plusAssign(i: Int)
|
||||
}
|
||||
fun test(l: A) {
|
||||
<expr>l</expr> += 1
|
||||
}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
KtSuccessCallInfo:
|
||||
call = KtSimpleVariableAccessCall:
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = A
|
||||
symbol = l: A
|
||||
simpleAccess = Read:
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
fun test() {
|
||||
var i = 1
|
||||
<expr>i += 1</expr>
|
||||
}
|
||||
+27
@@ -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(<dispatch receiver>: 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
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
fun test() {
|
||||
var i = 1
|
||||
<expr>i</expr> += 1
|
||||
}
|
||||
Vendored
+10
@@ -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:
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
interface MyMap<K, V> {
|
||||
operator fun get(k: K): V
|
||||
operator fun set(k: K, v: V)
|
||||
}
|
||||
|
||||
fun test(m: MyMap<String, Int>) {
|
||||
<expr>m["a"] += 1</expr>
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
KtSuccessCallInfo:
|
||||
call = KtCompoundArrayAccessCall:
|
||||
compoundAccess = CompoundAssign:
|
||||
kind = PLUS_ASSIGN
|
||||
operand = 1
|
||||
operationPartiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = KtExplicitReceiverValue:
|
||||
expression = m["a"]
|
||||
isSafeNavigation = false
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = kotlin/Int.plus(<dispatch receiver>: kotlin.Int, other: kotlin.Int): kotlin.Int
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = other: kotlin.Int
|
||||
]
|
||||
getPartiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = KtExplicitReceiverValue:
|
||||
expression = m
|
||||
isSafeNavigation = false
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = /MyMap.get(<dispatch receiver>: MyMap<kotlin.String, kotlin.Int>, 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(<dispatch receiver>: MyMap<kotlin.String, kotlin.Int>, 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
|
||||
]
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
interface MyMap<K1, V1> {
|
||||
operator fun get(k: K1): V1
|
||||
}
|
||||
|
||||
interface Foo {
|
||||
operator fun <K2, V2> MyMap<K2, V2>.set(k: K2, v: V2)
|
||||
|
||||
fun test(m: MyMap<String, Int>) {
|
||||
<expr>m["a"] += 1</expr>
|
||||
}
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
KtSuccessCallInfo:
|
||||
call = KtCompoundArrayAccessCall:
|
||||
compoundAccess = CompoundAssign:
|
||||
kind = PLUS_ASSIGN
|
||||
operand = 1
|
||||
operationPartiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = KtExplicitReceiverValue:
|
||||
expression = m["a"]
|
||||
isSafeNavigation = false
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = kotlin/Int.plus(<dispatch receiver>: kotlin.Int, other: kotlin.Int): kotlin.Int
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = other: kotlin.Int
|
||||
]
|
||||
getPartiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = KtExplicitReceiverValue:
|
||||
expression = m
|
||||
isSafeNavigation = false
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = /MyMap.get(<dispatch receiver>: MyMap<kotlin.String, kotlin.Int>, 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<kotlin.String, kotlin.Int>
|
||||
returnType = kotlin.Unit
|
||||
symbol = /Foo.set(<extension receiver>: MyMap<K2, V2>, <dispatch receiver>: Foo, k: K2, v: V2): kotlin.Unit
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.String
|
||||
symbol = k: K2,
|
||||
KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = v: V2
|
||||
]
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
interface MyMap<K, V> {
|
||||
operator fun get(k: K): V
|
||||
operator fun set(k: K, v: V)
|
||||
}
|
||||
|
||||
fun test(m: MyMap<String, Int>) {
|
||||
<expr>m["a"]</expr> += 1
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
KtSuccessCallInfo:
|
||||
call = KtSimpleFunctionCall:
|
||||
isImplicitInvoke = false
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = KtExplicitReceiverValue:
|
||||
expression = m
|
||||
isSafeNavigation = false
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = /MyMap.get(<dispatch receiver>: MyMap<kotlin.String, kotlin.Int>, 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)
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
interface A {
|
||||
operator fun plusAssign(i: Int)
|
||||
}
|
||||
|
||||
interface MyMap<K, V> {
|
||||
operator fun get(k: K): V
|
||||
}
|
||||
|
||||
fun test(m: MyMap<String, A>) {
|
||||
<expr>m["a"] += 1</expr>
|
||||
}
|
||||
+24
@@ -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(<dispatch receiver>: 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)
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
interface A {
|
||||
operator fun plusAssign(i: Int)
|
||||
}
|
||||
|
||||
interface MyMap<K, V> {
|
||||
operator fun get(k: K): V
|
||||
}
|
||||
|
||||
fun test(m: MyMap<String, A>) {
|
||||
<expr>m["a"]</expr> += 1
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
KtSuccessCallInfo:
|
||||
call = KtSimpleFunctionCall:
|
||||
isImplicitInvoke = false
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = KtExplicitReceiverValue:
|
||||
expression = m
|
||||
isSafeNavigation = false
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = A
|
||||
symbol = /MyMap.get(<dispatch receiver>: MyMap<kotlin.String, A>, 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)
|
||||
}
|
||||
Vendored
+6
@@ -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) {
|
||||
<expr>i()</expr>()()
|
||||
}
|
||||
Vendored
+14
@@ -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(<extension receiver>: kotlin.Int): kotlin.Long
|
||||
valueParameters = []
|
||||
argumentMapping = {}
|
||||
Vendored
+6
@@ -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) {
|
||||
<expr>i()()</expr>()
|
||||
}
|
||||
Vendored
+14
@@ -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(<extension receiver>: kotlin.Long): kotlin.Double
|
||||
valueParameters = []
|
||||
argumentMapping = {}
|
||||
Vendored
+6
@@ -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) {
|
||||
<expr>i()()()</expr>
|
||||
}
|
||||
Vendored
+14
@@ -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(<extension receiver>: kotlin.Double): kotlin.Unit
|
||||
valueParameters = []
|
||||
argumentMapping = {}
|
||||
+6
@@ -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) {
|
||||
<expr>i</expr>()()()
|
||||
}
|
||||
+10
@@ -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:
|
||||
+22
-4
@@ -1,4 +1,22 @@
|
||||
KtDelegatedConstructorCall:
|
||||
argumentMapping = { i + j -> (p1: kotlin.Int) }
|
||||
targetFunction = <constructor>(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 = <constructor>(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)
|
||||
}
|
||||
+25
-4
@@ -1,4 +1,25 @@
|
||||
KtDelegatedConstructorCall:
|
||||
argumentMapping = { s -> (p1: kotlin.Int) }
|
||||
targetFunction = ERR<Argument type mismatch: actual type is kotlin/String but kotlin/Int was expected, [<constructor>(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 = <constructor>(p1: kotlin.Int): Base
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = p1: kotlin.Int
|
||||
]
|
||||
argumentMapping = {
|
||||
s -> (KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = p1: kotlin.Int)
|
||||
}
|
||||
]
|
||||
diagnostic = ERROR<ARGUMENT_TYPE_MISMATCH: Argument type mismatch: actual type is kotlin/String but kotlin/Int was expected>
|
||||
analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_this.txt
Vendored
+22
-4
@@ -1,4 +1,22 @@
|
||||
KtDelegatedConstructorCall:
|
||||
argumentMapping = { s.length -> (p1: kotlin.Int) }
|
||||
targetFunction = <constructor>(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 = <constructor>(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)
|
||||
}
|
||||
+40
-4
@@ -1,4 +1,40 @@
|
||||
KtDelegatedConstructorCall:
|
||||
argumentMapping = { }
|
||||
targetFunction = ERR<None of the following functions are applicable: [/Sub.Sub, /Sub.Sub], [<constructor>(p: kotlin.Int): Sub, <constructor>(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 = <constructor>(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 = <constructor>(i: kotlin.Int, j: kotlin.Int): Sub
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = i: kotlin.Int,
|
||||
KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = j: kotlin.Int
|
||||
]
|
||||
argumentMapping = {}
|
||||
]
|
||||
diagnostic = ERROR<NONE_APPLICABLE: None of the following functions are applicable: [/Sub.Sub, /Sub.Sub]>
|
||||
Vendored
+21
-3
@@ -1,3 +1,21 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { Color.R -> (color: Color) }
|
||||
targetFunction = <constructor>(color: Color): Annotation
|
||||
KtSuccessCallInfo:
|
||||
call = KtAnnotationCall:
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = Annotation
|
||||
symbol = <constructor>(color: Color): Annotation
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = Color
|
||||
symbol = color: Color
|
||||
]
|
||||
argumentMapping = {
|
||||
Color.R -> (KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = Color
|
||||
symbol = color: Color)
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class B
|
||||
|
||||
fun test(b1: B, b2: B) {
|
||||
<expr>b1 == b2</expr>
|
||||
}
|
||||
+24
@@ -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(<dispatch receiver>: 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?)
|
||||
}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
open class A {
|
||||
override fun equals(other: Any?): Boolean {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
class B : A()
|
||||
|
||||
fun test(b1: B, b2: B) {
|
||||
<expr>b1 == b2</expr>
|
||||
}
|
||||
Vendored
+24
@@ -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(<dispatch receiver>: 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?)
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
open class A {
|
||||
override fun equals(other: Any?): Boolean {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
fun test(a1: A, a2: A) {
|
||||
<expr>a1 == a2</expr>
|
||||
}
|
||||
+24
@@ -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(<dispatch receiver>: 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?)
|
||||
}
|
||||
Vendored
+22
-4
@@ -1,4 +1,22 @@
|
||||
KtFunctionCall:
|
||||
argumentMapping = { 1 -> (a: kotlin.Int) }
|
||||
targetFunction = /function(a: kotlin.Int): kotlin.Unit
|
||||
substitutor = <empty substitutor>
|
||||
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)
|
||||
}
|
||||
+24
-4
@@ -1,4 +1,24 @@
|
||||
KtFunctionCall:
|
||||
argumentMapping = { 1 -> (a: kotlin.Int) }
|
||||
targetFunction = /function(<extension receiver>: kotlin.String, a: kotlin.Int): kotlin.Unit
|
||||
substitutor = <map substitutor: {A = kotlin/String, B = kotlin/Int}>
|
||||
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(<extension receiver>: 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)
|
||||
}
|
||||
+30
-4
@@ -1,4 +1,30 @@
|
||||
KtFunctionCall:
|
||||
argumentMapping = { 1 -> (a: kotlin.Int), { s -> true } -> (b: kotlin.Function1<kotlin.String, kotlin.Boolean>) }
|
||||
targetFunction = /function(a: kotlin.Int, b: kotlin.Function1<kotlin.String, kotlin.Boolean>): kotlin.Unit
|
||||
substitutor = <empty substitutor>
|
||||
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.String, kotlin.Boolean>): kotlin.Unit
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = a: kotlin.Int,
|
||||
KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Function1<kotlin.String, kotlin.Boolean>
|
||||
symbol = b: kotlin.Function1<kotlin.String, kotlin.Boolean>
|
||||
]
|
||||
argumentMapping = {
|
||||
1 -> (KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = a: kotlin.Int),
|
||||
{ s -> true } -> (KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Function1<kotlin.String, kotlin.Boolean>
|
||||
symbol = b: kotlin.Function1<kotlin.String, kotlin.Boolean>)
|
||||
}
|
||||
analysis/analysis-api/testData/components/callResolver/resolveCall/functionCallWithNamedArgument.txt
Vendored
+30
-4
@@ -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 = <empty substitutor>
|
||||
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)
|
||||
}
|
||||
+30
-4
@@ -1,4 +1,30 @@
|
||||
KtFunctionCall:
|
||||
argumentMapping = { 1 -> (a: kotlin.Int), { s -> true } -> (b: kotlin.Function1<kotlin.String, kotlin.Boolean>) }
|
||||
targetFunction = /function(a: kotlin.Int, b: kotlin.Function1<kotlin.String, kotlin.Boolean>): kotlin.Unit
|
||||
substitutor = <empty substitutor>
|
||||
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.String, kotlin.Boolean>): kotlin.Unit
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = a: kotlin.Int,
|
||||
KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Function1<kotlin.String, kotlin.Boolean>
|
||||
symbol = b: kotlin.Function1<kotlin.String, kotlin.Boolean>
|
||||
]
|
||||
argumentMapping = {
|
||||
1 -> (KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = a: kotlin.Int),
|
||||
{ s -> true } -> (KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Function1<kotlin.String, kotlin.Boolean>
|
||||
symbol = b: kotlin.Function1<kotlin.String, kotlin.Boolean>)
|
||||
}
|
||||
+22
-4
@@ -1,4 +1,22 @@
|
||||
KtFunctionCall:
|
||||
argumentMapping = { args -> (vararg a: kotlin.Int) }
|
||||
targetFunction = /function(vararg a: kotlin.Int): kotlin.Unit
|
||||
substitutor = <empty 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)
|
||||
}
|
||||
Vendored
+30
-4
@@ -1,4 +1,30 @@
|
||||
KtFunctionCall:
|
||||
argumentMapping = { 1 -> (a: kotlin.Int), "" -> (b: kotlin.String) }
|
||||
targetFunction = /function(a: kotlin.Int, b: kotlin.String): kotlin.Unit
|
||||
substitutor = <map substitutor: {A = kotlin/Int, B = kotlin/String}>
|
||||
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)
|
||||
}
|
||||
+30
-4
@@ -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 = <empty 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)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class A {
|
||||
val f: String.() -> Unit = {}
|
||||
fun test() {
|
||||
"".<expr>f()</expr>
|
||||
}
|
||||
}
|
||||
+21
@@ -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(<dispatch receiver>: kotlin.Function1<kotlin.String, kotlin.Unit>, p1: kotlin.String): kotlin.Unit
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.String
|
||||
symbol = p1: kotlin.String
|
||||
]
|
||||
argumentMapping = {}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
class A {
|
||||
fun test() {
|
||||
"".<expr>f()</expr>
|
||||
}
|
||||
}
|
||||
|
||||
val A.f: String.() -> Unit = {}
|
||||
+21
@@ -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(<dispatch receiver>: kotlin.Function1<kotlin.String, kotlin.Unit>, p1: kotlin.String): kotlin.Unit
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.String
|
||||
symbol = p1: kotlin.String
|
||||
]
|
||||
argumentMapping = {}
|
||||
Vendored
+24
-4
@@ -1,4 +1,24 @@
|
||||
KtFunctionCall:
|
||||
argumentMapping = { 1 -> (a: kotlin.Int) }
|
||||
targetFunction = /function(<extension receiver>: kotlin.String, a: kotlin.Int): kotlin.Unit
|
||||
substitutor = <empty substitutor>
|
||||
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(<extension receiver>: 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)
|
||||
}
|
||||
Vendored
+24
-4
@@ -1,4 +1,24 @@
|
||||
KtFunctionCall:
|
||||
argumentMapping = { 1 -> (a: kotlin.Int) }
|
||||
targetFunction = /function(<extension receiver>: kotlin.String, a: kotlin.Int): kotlin.Unit
|
||||
substitutor = <empty substitutor>
|
||||
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(<extension receiver>: 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)
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
fun test() {
|
||||
<expr>Obj(555)</expr>
|
||||
}
|
||||
|
||||
object Obj
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
KtErrorCallInfo:
|
||||
candidateCalls = [
|
||||
KtSimpleFunctionCall:
|
||||
isImplicitInvoke = false
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = Obj
|
||||
symbol = <constructor>(): Obj
|
||||
valueParameters = []
|
||||
argumentMapping = {}
|
||||
]
|
||||
diagnostic = ERROR<INVISIBLE_REFERENCE: Symbol /Obj.Obj is invisible>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
@Deprecated("", level=DeprecationLevel.HIDDEN)
|
||||
fun a() {}
|
||||
|
||||
fun test() {
|
||||
<expr>a()</expr>
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
KtErrorCallInfo:
|
||||
candidateCalls = []
|
||||
diagnostic = ERROR<UNRESOLVED_REFERENCE: Unresolved reference: a>
|
||||
+22
-4
@@ -1,4 +1,22 @@
|
||||
KtFunctionCall:
|
||||
argumentMapping = { 42 -> (i: kotlin.Int) }
|
||||
targetFunction = <constructor>(i: kotlin.Int): A
|
||||
substitutor = <empty substitutor>
|
||||
KtSuccessCallInfo:
|
||||
call = KtSimpleFunctionCall:
|
||||
isImplicitInvoke = false
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = A
|
||||
symbol = <constructor>(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)
|
||||
}
|
||||
Vendored
+12
-4
@@ -1,4 +1,12 @@
|
||||
KtFunctionCall:
|
||||
argumentMapping = { }
|
||||
targetFunction = <constructor>(): A
|
||||
substitutor = <empty substitutor>
|
||||
KtSuccessCallInfo:
|
||||
call = KtSimpleFunctionCall:
|
||||
isImplicitInvoke = false
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = A
|
||||
symbol = <constructor>(): A
|
||||
valueParameters = []
|
||||
argumentMapping = {}
|
||||
Vendored
+12
-4
@@ -1,4 +1,12 @@
|
||||
KtFunctionCall:
|
||||
argumentMapping = { }
|
||||
targetFunction = <constructor>(): A
|
||||
substitutor = <empty substitutor>
|
||||
KtSuccessCallInfo:
|
||||
call = KtSimpleFunctionCall:
|
||||
isImplicitInvoke = false
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = A
|
||||
symbol = <constructor>(): A
|
||||
valueParameters = []
|
||||
argumentMapping = {}
|
||||
+32
-4
@@ -1,4 +1,32 @@
|
||||
KtFunctionCall:
|
||||
argumentMapping = { 1 -> (a: kotlin.Int), "foo" -> (b: kotlin.String) }
|
||||
targetFunction = /C.get(<dispatch receiver>: C, a: kotlin.Int, b: kotlin.String): kotlin.Boolean
|
||||
substitutor = <empty substitutor>
|
||||
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(<dispatch receiver>: C, a: kotlin.Int, b: kotlin.String): kotlin.Boolean
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = a: kotlin.Int,
|
||||
KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.String
|
||||
symbol = b: kotlin.String
|
||||
]
|
||||
argumentMapping = {
|
||||
1 -> (KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = a: kotlin.Int),
|
||||
"foo" -> (KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.String
|
||||
symbol = b: kotlin.String)
|
||||
}
|
||||
Vendored
+31
-4
@@ -1,4 +1,31 @@
|
||||
KtFunctionCall:
|
||||
argumentMapping = { 1 -> (a: kotlin.Int) }
|
||||
targetFunction = ERR<No value passed for parameter 'b', [/C.get(<dispatch receiver>: C, a: kotlin.Int, b: kotlin.String): kotlin.Boolean]>
|
||||
substitutor = <empty substitutor>
|
||||
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(<dispatch receiver>: C, a: kotlin.Int, b: kotlin.String): kotlin.Boolean
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = a: kotlin.Int,
|
||||
KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.String
|
||||
symbol = b: kotlin.String
|
||||
]
|
||||
argumentMapping = {
|
||||
1 -> (KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = a: kotlin.Int)
|
||||
}
|
||||
]
|
||||
diagnostic = ERROR<NO_VALUE_FOR_PARAMETER: No value passed for parameter 'b'>
|
||||
Vendored
+35
-4
@@ -1,4 +1,35 @@
|
||||
KtFunctionCall:
|
||||
argumentMapping = { 1 -> (a: kotlin.Int), "foo" -> (b: kotlin.String) }
|
||||
targetFunction = ERR<Too many arguments for public final operator fun /C.get(a: R|kotlin/Int|, b: R|kotlin/String|): R|kotlin/Boolean|, [/C.get(<dispatch receiver>: C, a: kotlin.Int, b: kotlin.String): kotlin.Boolean]>
|
||||
substitutor = <empty substitutor>
|
||||
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(<dispatch receiver>: C, a: kotlin.Int, b: kotlin.String): kotlin.Boolean
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = a: kotlin.Int,
|
||||
KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.String
|
||||
symbol = b: kotlin.String
|
||||
]
|
||||
argumentMapping = {
|
||||
1 -> (KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = a: kotlin.Int),
|
||||
"foo" -> (KtVariableLikeSignature:
|
||||
receiverType = null
|
||||
returnType = kotlin.String
|
||||
symbol = b: kotlin.String)
|
||||
}
|
||||
]
|
||||
diagnostic = ERROR<TOO_MANY_ARGUMENTS: Too many arguments for public final operator fun /C.get(a: R|kotlin/Int|, b: R|kotlin/String|): R|kotlin/Boolean|>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user