Analysis API: Get argument mapping from candidate and type parameters

from candidate symbol.
This commit is contained in:
Mark Punzalan
2022-01-31 17:58:28 +00:00
committed by Ilya Kirillov
parent 0ed802bca4
commit ace826c570
19 changed files with 887 additions and 14 deletions
@@ -34,6 +34,24 @@ public class Fe10ResolveCallTestGenerated extends AbstractResolveCallTest {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/callResolver/resolveCall"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("ambiguous.kt")
public void testAmbiguous() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/ambiguous.kt");
}
@Test
@TestMetadata("ambiguousWithExplicitTypeParameters.kt")
public void testAmbiguousWithExplicitTypeParameters() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/ambiguousWithExplicitTypeParameters.kt");
}
@Test
@TestMetadata("ambiguousWithInferredTypeParameters.kt")
public void testAmbiguousWithInferredTypeParameters() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/ambiguousWithInferredTypeParameters.kt");
}
@Test
@TestMetadata("annotationEntry.kt")
public void testAnnotationEntry() throws Exception {
@@ -250,7 +250,7 @@ internal class KtFirCallResolver(
?: return null
if (targetSymbol !is FirCallableSymbol<*>) return null
if (targetSymbol is FirErrorFunctionSymbol || targetSymbol is FirErrorPropertySymbol) return null
val unsbustitutedKtSignature = targetSymbol.toKtSignature()
val unsubstitutedKtSignature = targetSymbol.toKtSignature()
handleCompoundAccessCall(psi, fir, resolveFragmentOfCall)?.let { return it }
@@ -261,9 +261,9 @@ internal class KtFirCallResolver(
// candidate, `Candidate.substitutor` is not complete. maybe we can carry over the final substitutor if it's available from
// body resolve phase?
val substitutor =
(fir as? FirQualifiedAccess)?.createConeSubstitutorFromTypeArguments()?.toKtSubstitutor() ?: KtSubstitutor.Empty(token)
(fir as? FirQualifiedAccess)?.createSubstitutorFromTypeArguments(targetSymbol) ?: KtSubstitutor.Empty(token)
KtPartiallyAppliedSymbol(
unsbustitutedKtSignature.substitute(substitutor),
unsubstitutedKtSignature.substitute(substitutor),
candidate.dispatchReceiverValue?.receiverExpression?.toKtReceiverValue(),
candidate.extensionReceiverValue?.receiverExpression?.toKtReceiverValue(),
)
@@ -304,17 +304,17 @@ internal class KtFirCallResolver(
}
val substitutor = fir.createConeSubstitutorFromTypeArguments() ?: return null
KtPartiallyAppliedSymbol(
unsbustitutedKtSignature.substitute(substitutor.toKtSubstitutor()),
unsubstitutedKtSignature.substitute(substitutor.toKtSubstitutor()),
dispatchReceiver,
extensionReceiver,
)
} else {
KtPartiallyAppliedSymbol(unsbustitutedKtSignature, null, null)
KtPartiallyAppliedSymbol(unsubstitutedKtSignature, _dispatchReceiver = null, _extensionReceiver = null)
}
return when (fir) {
is FirAnnotationCall -> {
if (unsbustitutedKtSignature.symbol !is KtConstructorSymbol) return null
if (unsubstitutedKtSignature.symbol !is KtConstructorSymbol) return null
@Suppress("UNCHECKED_CAST") // safe because of the above check on targetKtSymbol
KtAnnotationCall(
partiallyAppliedSymbol as KtPartiallyAppliedFunctionSymbol<KtConstructorSymbol>,
@@ -322,7 +322,7 @@ internal class KtFirCallResolver(
)
}
is FirDelegatedConstructorCall -> {
if (unsbustitutedKtSignature.symbol !is KtConstructorSymbol) return null
if (unsubstitutedKtSignature.symbol !is KtConstructorSymbol) return null
@Suppress("UNCHECKED_CAST") // safe because of the above check on targetKtSymbol
KtDelegatedConstructorCall(
partiallyAppliedSymbol as KtPartiallyAppliedFunctionSymbol<KtConstructorSymbol>,
@@ -331,7 +331,7 @@ internal class KtFirCallResolver(
)
}
is FirVariableAssignment -> {
if (unsbustitutedKtSignature.symbol !is KtVariableLikeSymbol) return null
if (unsubstitutedKtSignature.symbol !is KtVariableLikeSymbol) return null
val rhs = fir.rValue.psi as? KtExpression
@Suppress("UNCHECKED_CAST") // safe because of the above check on targetKtSymbol
KtSimpleVariableAccessCall(
@@ -340,7 +340,7 @@ internal class KtFirCallResolver(
)
}
is FirPropertyAccessExpression -> {
if (unsbustitutedKtSignature.symbol !is KtVariableLikeSymbol) return null
if (unsubstitutedKtSignature.symbol !is KtVariableLikeSymbol) return null
@Suppress("UNCHECKED_CAST") // safe because of the above check on targetKtSymbol
KtSimpleVariableAccessCall(
partiallyAppliedSymbol as KtPartiallyAppliedVariableSymbol<KtVariableLikeSymbol>,
@@ -348,17 +348,22 @@ internal class KtFirCallResolver(
)
}
is FirFunctionCall -> {
if (unsbustitutedKtSignature.symbol !is KtFunctionLikeSymbol) return null
val argumentMapping =
if (unsubstitutedKtSignature.symbol !is KtFunctionLikeSymbol) return null
val argumentMapping = if (candidate is Candidate) {
candidate.argumentMapping
} else {
fir.argumentMapping
}
val argumentMappingWithoutExtensionReceiver =
if (firstArgIsExtensionReceiver) {
fir.argumentMapping?.entries?.drop(1)
argumentMapping?.entries?.drop(1)
} else {
fir.argumentMapping?.entries
argumentMapping?.entries
}
@Suppress("UNCHECKED_CAST") // safe because of the above check on targetKtSymbol
KtSimpleFunctionCall(
partiallyAppliedSymbol as KtPartiallyAppliedFunctionSymbol<KtFunctionLikeSymbol>,
argumentMapping
argumentMappingWithoutExtensionReceiver
?.createArgumentMapping(partiallyAppliedSymbol.signature as KtFunctionLikeSignature<*>)
?: LinkedHashMap(),
fir is FirImplicitInvokeCall
@@ -34,6 +34,24 @@ public class FirResolveCallTestGenerated extends AbstractResolveCallTest {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/callResolver/resolveCall"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("ambiguous.kt")
public void testAmbiguous() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/ambiguous.kt");
}
@Test
@TestMetadata("ambiguousWithExplicitTypeParameters.kt")
public void testAmbiguousWithExplicitTypeParameters() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/ambiguousWithExplicitTypeParameters.kt");
}
@Test
@TestMetadata("ambiguousWithInferredTypeParameters.kt")
public void testAmbiguousWithInferredTypeParameters() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/ambiguousWithInferredTypeParameters.kt");
}
@Test
@TestMetadata("annotationEntry.kt")
public void testAnnotationEntry() throws Exception {
@@ -40,6 +40,34 @@ public class FirResolveCandidatesTestGenerated extends AbstractResolveCandidates
runTest("analysis/analysis-api/testData/components/callResolver/resolveCandidates/noCandidates.kt");
}
@Nested
@TestMetadata("analysis/analysis-api/testData/components/callResolver/resolveCandidates/multipleCandidates")
@TestDataPath("$PROJECT_ROOT")
public class MultipleCandidates {
@Test
public void testAllFilesPresentInMultipleCandidates() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/callResolver/resolveCandidates/multipleCandidates"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("ambiguous.kt")
public void testAmbiguous() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCandidates/multipleCandidates/ambiguous.kt");
}
@Test
@TestMetadata("ambiguousWithExplicitTypeParameters.kt")
public void testAmbiguousWithExplicitTypeParameters() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCandidates/multipleCandidates/ambiguousWithExplicitTypeParameters.kt");
}
@Test
@TestMetadata("ambiguousWithInferredTypeParameters.kt")
public void testAmbiguousWithInferredTypeParameters() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCandidates/multipleCandidates/ambiguousWithInferredTypeParameters.kt");
}
}
@Nested
@TestMetadata("analysis/analysis-api/testData/components/callResolver/resolveCandidates/singleCandidate")
@TestDataPath("$PROJECT_ROOT")
@@ -0,0 +1,76 @@
KtErrorCallInfo:
candidateCalls = [
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(a: kotlin.Char): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = a
receiverType = null
returnType = kotlin.Char
symbol = a: kotlin.Char
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
name = a
receiverType = null
returnType = kotlin.Char
symbol = a: kotlin.Char)
},
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(b: kotlin.Boolean): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = b
receiverType = null
returnType = kotlin.Boolean
symbol = b: kotlin.Boolean
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
name = b
receiverType = null
returnType = kotlin.Boolean
symbol = b: kotlin.Boolean)
},
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(c: kotlin.String): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = c
receiverType = null
returnType = kotlin.String
symbol = c: kotlin.String
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
name = c
receiverType = null
returnType = kotlin.String
symbol = c: kotlin.String)
}
]
diagnostic = ERROR<NONE_APPLICABLE: None of the following functions can be called with the arguments supplied:
public fun function(b: Boolean): Unit defined in root package in file ambiguous.kt
public fun function(a: Char): Unit defined in root package in file ambiguous.kt
public fun function(c: String): Unit defined in root package in file ambiguous.kt>
@@ -0,0 +1,7 @@
fun function(a: Char) {}
fun function(b: Boolean) {}
fun function(c: String) {}
fun call() {
<expr>function(1)</expr>
}
@@ -0,0 +1,73 @@
KtErrorCallInfo:
candidateCalls = [
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(a: kotlin.Char): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = a
receiverType = null
returnType = kotlin.Char
symbol = a: kotlin.Char
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
name = a
receiverType = null
returnType = kotlin.Char
symbol = a: kotlin.Char)
},
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(b: kotlin.Boolean): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = b
receiverType = null
returnType = kotlin.Boolean
symbol = b: kotlin.Boolean
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
name = b
receiverType = null
returnType = kotlin.Boolean
symbol = b: kotlin.Boolean)
},
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(c: kotlin.String): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = c
receiverType = null
returnType = kotlin.String
symbol = c: kotlin.String
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
name = c
receiverType = null
returnType = kotlin.String
symbol = c: kotlin.String)
}
]
diagnostic = ERROR<NONE_APPLICABLE: None of the following functions are applicable: [/function, /function, /function]>
@@ -0,0 +1,91 @@
KtErrorCallInfo:
candidateCalls = [
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(t: T, a: kotlin.Char): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = t
receiverType = null
returnType = TypeVariable(T)
symbol = t: T,
KtVariableLikeSignature:
name = a
receiverType = null
returnType = kotlin.Char
symbol = a: kotlin.Char
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
name = t
receiverType = null
returnType = TypeVariable(T)
symbol = t: T)
},
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(u: U, b: kotlin.Boolean): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = u
receiverType = null
returnType = TypeVariable(U)
symbol = u: U,
KtVariableLikeSignature:
name = b
receiverType = null
returnType = kotlin.Boolean
symbol = b: kotlin.Boolean
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
name = u
receiverType = null
returnType = TypeVariable(U)
symbol = u: U)
},
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(v: V, c: kotlin.String): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = v
receiverType = null
returnType = TypeVariable(V)
symbol = v: V,
KtVariableLikeSignature:
name = c
receiverType = null
returnType = kotlin.String
symbol = c: kotlin.String
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
name = v
receiverType = null
returnType = TypeVariable(V)
symbol = v: V)
}
]
diagnostic = ERROR<NONE_APPLICABLE: None of the following functions can be called with the arguments supplied:
public fun <T> function(t: TypeVariable(T), a: Char): Unit defined in root package in file ambiguousWithExplicitTypeParameters.kt
public fun <U> function(u: TypeVariable(U), b: Boolean): Unit defined in root package in file ambiguousWithExplicitTypeParameters.kt
public fun <V> function(v: TypeVariable(V), c: String): Unit defined in root package in file ambiguousWithExplicitTypeParameters.kt>
@@ -0,0 +1,7 @@
fun <T> function(t: T, a: Char) {}
fun <U> function(u: U, b: Boolean) {}
fun <V> function(v: V, c: String) {}
fun call() {
<expr>function<Int>(1)</expr>
}
@@ -0,0 +1,88 @@
KtErrorCallInfo:
candidateCalls = [
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(t: T, a: kotlin.Char): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = t
receiverType = null
returnType = kotlin.Int
symbol = t: T,
KtVariableLikeSignature:
name = a
receiverType = null
returnType = kotlin.Char
symbol = a: kotlin.Char
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
name = t
receiverType = null
returnType = kotlin.Int
symbol = t: T)
},
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(u: U, b: kotlin.Boolean): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = u
receiverType = null
returnType = kotlin.Int
symbol = u: U,
KtVariableLikeSignature:
name = b
receiverType = null
returnType = kotlin.Boolean
symbol = b: kotlin.Boolean
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
name = u
receiverType = null
returnType = kotlin.Int
symbol = u: U)
},
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(v: V, c: kotlin.String): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = v
receiverType = null
returnType = kotlin.Int
symbol = v: V,
KtVariableLikeSignature:
name = c
receiverType = null
returnType = kotlin.String
symbol = c: kotlin.String
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
name = v
receiverType = null
returnType = kotlin.Int
symbol = v: V)
}
]
diagnostic = ERROR<NONE_APPLICABLE: None of the following functions are applicable: [/function, /function, /function]>
@@ -0,0 +1,91 @@
KtErrorCallInfo:
candidateCalls = [
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(t: T, a: kotlin.Char): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = t
receiverType = null
returnType = TypeVariable(T)
symbol = t: T,
KtVariableLikeSignature:
name = a
receiverType = null
returnType = kotlin.Char
symbol = a: kotlin.Char
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
name = t
receiverType = null
returnType = TypeVariable(T)
symbol = t: T)
},
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(u: U, b: kotlin.Boolean): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = u
receiverType = null
returnType = TypeVariable(U)
symbol = u: U,
KtVariableLikeSignature:
name = b
receiverType = null
returnType = kotlin.Boolean
symbol = b: kotlin.Boolean
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
name = u
receiverType = null
returnType = TypeVariable(U)
symbol = u: U)
},
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(v: V, c: kotlin.String): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = v
receiverType = null
returnType = TypeVariable(V)
symbol = v: V,
KtVariableLikeSignature:
name = c
receiverType = null
returnType = kotlin.String
symbol = c: kotlin.String
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
name = v
receiverType = null
returnType = TypeVariable(V)
symbol = v: V)
}
]
diagnostic = ERROR<NONE_APPLICABLE: None of the following functions can be called with the arguments supplied:
public fun <T> function(t: TypeVariable(T), a: Char): Unit defined in root package in file ambiguousWithInferredTypeParameters.kt
public fun <U> function(u: TypeVariable(U), b: Boolean): Unit defined in root package in file ambiguousWithInferredTypeParameters.kt
public fun <V> function(v: TypeVariable(V), c: String): Unit defined in root package in file ambiguousWithInferredTypeParameters.kt>
@@ -0,0 +1,7 @@
fun <T> function(t: T, a: Char) {}
fun <U> function(u: U, b: Boolean) {}
fun <V> function(v: V, c: String) {}
fun call() {
<expr>function(1)</expr>
}
@@ -0,0 +1,88 @@
KtErrorCallInfo:
candidateCalls = [
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(t: T, a: kotlin.Char): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = t
receiverType = null
returnType = T
symbol = t: T,
KtVariableLikeSignature:
name = a
receiverType = null
returnType = kotlin.Char
symbol = a: kotlin.Char
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
name = t
receiverType = null
returnType = T
symbol = t: T)
},
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(u: U, b: kotlin.Boolean): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = u
receiverType = null
returnType = U
symbol = u: U,
KtVariableLikeSignature:
name = b
receiverType = null
returnType = kotlin.Boolean
symbol = b: kotlin.Boolean
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
name = u
receiverType = null
returnType = U
symbol = u: U)
},
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(v: V, c: kotlin.String): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = v
receiverType = null
returnType = V
symbol = v: V,
KtVariableLikeSignature:
name = c
receiverType = null
returnType = kotlin.String
symbol = c: kotlin.String
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
name = v
receiverType = null
returnType = V
symbol = v: V)
}
]
diagnostic = ERROR<NONE_APPLICABLE: None of the following functions are applicable: [/function, /function, /function]>
@@ -0,0 +1,7 @@
fun function(a: Char) {}
fun function(b: Boolean) {}
fun function(c: String) {}
fun call() {
<expr>function(1)</expr>
}
@@ -0,0 +1,77 @@
KtErrorCallInfo:
candidateCalls = [
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(a: kotlin.Char): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Char
symbol = a: kotlin.Char
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Char
symbol = a: kotlin.Char)
}
]
diagnostic = ERROR<ARGUMENT_TYPE_MISMATCH: Argument type mismatch: actual type is kotlin/Int but kotlin/Char was expected>
KtErrorCallInfo:
candidateCalls = [
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(b: kotlin.Boolean): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Boolean
symbol = b: kotlin.Boolean
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Boolean
symbol = b: kotlin.Boolean)
}
]
diagnostic = ERROR<ARGUMENT_TYPE_MISMATCH: Argument type mismatch: actual type is kotlin/Int but kotlin/Boolean was expected>
KtErrorCallInfo:
candidateCalls = [
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(c: kotlin.String): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = c: kotlin.String
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = c: kotlin.String)
}
]
diagnostic = ERROR<ARGUMENT_TYPE_MISMATCH: Argument type mismatch: actual type is kotlin/Int but kotlin/String was expected>
@@ -0,0 +1,7 @@
fun <T> function(t: T, a: Char) {}
fun <U> function(u: U, b: Boolean) {}
fun <V> function(v: V, c: String) {}
fun call() {
<expr>function<Int>(1)</expr>
}
@@ -0,0 +1,89 @@
KtErrorCallInfo:
candidateCalls = [
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(t: T, a: kotlin.Char): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = t: T,
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Char
symbol = a: kotlin.Char
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = t: T)
}
]
diagnostic = ERROR<NO_VALUE_FOR_PARAMETER: No value passed for parameter 'a'>
KtErrorCallInfo:
candidateCalls = [
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(u: U, b: kotlin.Boolean): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = u: U,
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Boolean
symbol = b: kotlin.Boolean
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = u: U)
}
]
diagnostic = ERROR<NO_VALUE_FOR_PARAMETER: No value passed for parameter 'b'>
KtErrorCallInfo:
candidateCalls = [
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(v: V, c: kotlin.String): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = v: V,
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = c: kotlin.String
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Int
symbol = v: V)
}
]
diagnostic = ERROR<NO_VALUE_FOR_PARAMETER: No value passed for parameter 'c'>
@@ -0,0 +1,7 @@
fun <T> function(t: T, a: Char) {}
fun <U> function(u: U, b: Boolean) {}
fun <V> function(v: V, c: String) {}
fun call() {
<expr>function(1)</expr>
}
@@ -0,0 +1,89 @@
KtErrorCallInfo:
candidateCalls = [
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(t: T, a: kotlin.Char): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = T
symbol = t: T,
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Char
symbol = a: kotlin.Char
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
receiverType = null
returnType = T
symbol = t: T)
}
]
diagnostic = ERROR<NO_VALUE_FOR_PARAMETER: No value passed for parameter 'a'>
KtErrorCallInfo:
candidateCalls = [
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(u: U, b: kotlin.Boolean): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = U
symbol = u: U,
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.Boolean
symbol = b: kotlin.Boolean
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
receiverType = null
returnType = U
symbol = u: U)
}
]
diagnostic = ERROR<NO_VALUE_FOR_PARAMETER: No value passed for parameter 'b'>
KtErrorCallInfo:
candidateCalls = [
KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /function(v: V, c: kotlin.String): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
receiverType = null
returnType = V
symbol = v: V,
KtVariableLikeSignature:
receiverType = null
returnType = kotlin.String
symbol = c: kotlin.String
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
receiverType = null
returnType = V
symbol = v: V)
}
]
diagnostic = ERROR<NO_VALUE_FOR_PARAMETER: No value passed for parameter 'c'>