Analysis API: Implement KtCallResolver.collectAllCandidates for FE 1.0.

This commit is contained in:
Mark Punzalan
2022-02-14 07:11:56 +00:00
committed by Ilya Kirillov
parent 81a66258fa
commit afb34d3193
28 changed files with 1393 additions and 31 deletions
@@ -46,4 +46,4 @@ KtErrorCallInfo:
symbol = value: kotlin.Boolean)
}
]
diagnostic = ERROR<TOO_MANY_ARGUMENTS: Too many arguments for public final operator fun set(a: Int, b: String, value: Boolean): Unit defined in C>
diagnostic = ERROR<CONSTANT_EXPECTED_TYPE_MISMATCH: The floating-point literal does not conform to the expected type Boolean>
@@ -0,0 +1,80 @@
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<CONSTANT_EXPECTED_TYPE_MISMATCH: The integer literal does not conform to the expected type Char>
candidate = 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)
}
isInBestCandidates = true
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<CONSTANT_EXPECTED_TYPE_MISMATCH: The integer literal does not conform to the expected type Boolean>
candidate = 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)
}
isInBestCandidates = true
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<CONSTANT_EXPECTED_TYPE_MISMATCH: The integer literal does not conform to the expected type String>
candidate = 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)
}
isInBestCandidates = true
@@ -0,0 +1,95 @@
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<NO_VALUE_FOR_PARAMETER: No value passed for parameter 'a'>
candidate = 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)
}
isInBestCandidates = true
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<NO_VALUE_FOR_PARAMETER: No value passed for parameter 'b'>
candidate = 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)
}
isInBestCandidates = true
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<NO_VALUE_FOR_PARAMETER: No value passed for parameter 'c'>
candidate = 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)
}
isInBestCandidates = true
@@ -0,0 +1,81 @@
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<CONSTANT_EXPECTED_TYPE_MISMATCH: The boolean literal does not conform to the expected type Int>
candidate = KtSimpleFunctionCall:
isImplicitInvoke = true
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = KtExplicitReceiverValue:
expression = x
isSafeNavigation = false
signature = KtFunctionLikeSignature:
receiverType = kotlin.Int
returnType = kotlin.Unit
symbol = /invoke(<extension receiver>: kotlin.Int, i: kotlin.Int): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = i
receiverType = null
returnType = kotlin.Int
symbol = i: kotlin.Int
]
argumentMapping = {
true -> (KtVariableLikeSignature:
name = i
receiverType = null
returnType = kotlin.Int
symbol = i: kotlin.Int)
}
isInBestCandidates = false
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<CONSTANT_EXPECTED_TYPE_MISMATCH: The boolean literal does not conform to the expected type Char>
candidate = KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /x(c: kotlin.Char): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = c
receiverType = null
returnType = kotlin.Char
symbol = c: kotlin.Char
]
argumentMapping = {
true -> (KtVariableLikeSignature:
name = c
receiverType = null
returnType = kotlin.Char
symbol = c: kotlin.Char)
}
isInBestCandidates = false
KtApplicableCallCandidateInfo:
candidate = KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = x(b: kotlin.Boolean): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = b
receiverType = null
returnType = kotlin.Boolean
symbol = b: kotlin.Boolean
]
argumentMapping = {
true -> (KtVariableLikeSignature:
name = b
receiverType = null
returnType = kotlin.Boolean
symbol = b: kotlin.Boolean)
}
isInBestCandidates = true
@@ -0,0 +1,56 @@
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<CONSTANT_EXPECTED_TYPE_MISMATCH: The integer literal does not conform to the expected type Boolean>
candidate = KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = a
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /A.x(<dispatch receiver>: A, 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)
}
isInBestCandidates = false
KtApplicableCallCandidateInfo:
candidate = KtSimpleFunctionCall:
isImplicitInvoke = true
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = KtExplicitReceiverValue:
expression = x
isSafeNavigation = false
signature = KtFunctionLikeSignature:
receiverType = kotlin.Int
returnType = kotlin.Unit
symbol = /invoke(<extension receiver>: kotlin.Int, i: kotlin.Int): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = i
receiverType = null
returnType = kotlin.Int
symbol = i: kotlin.Int
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
name = i
receiverType = null
returnType = kotlin.Int
symbol = i: kotlin.Int)
}
isInBestCandidates = true
@@ -0,0 +1,28 @@
KtApplicableCallCandidateInfo:
candidate = KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtImplicitReceiverValue:
symbol = KtReceiverParameterSymbol:
origin: SOURCE
type: test/Target<kotlin/String>
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = test/Target.add(<dispatch receiver>: test.Target<T>, t: T): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = t
receiverType = null
returnType = kotlin.String
symbol = t: T
]
argumentMapping = {
s -> (KtVariableLikeSignature:
name = t
receiverType = null
returnType = kotlin.String
symbol = t: T)
}
isInBestCandidates = true
@@ -0,0 +1,49 @@
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<TYPE_MISMATCH: Type mismatch: inferred type is Int but Double was expected>
candidate = 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 = {}
isInBestCandidates = false
KtApplicableCallCandidateInfo:
candidate = 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 = {}
isInBestCandidates = true
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<TYPE_MISMATCH: Type mismatch: inferred type is Int but Long was expected>
candidate = 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 = {}
isInBestCandidates = false
@@ -0,0 +1,49 @@
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<TYPE_MISMATCH: Type mismatch: inferred type is Long but Double was expected>
candidate = 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 = {}
isInBestCandidates = false
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<TYPE_MISMATCH: Type mismatch: inferred type is Long but Int was expected>
candidate = 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 = {}
isInBestCandidates = false
KtApplicableCallCandidateInfo:
candidate = 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 = {}
isInBestCandidates = true
@@ -0,0 +1,49 @@
KtApplicableCallCandidateInfo:
candidate = 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 = {}
isInBestCandidates = true
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<TYPE_MISMATCH: Type mismatch: inferred type is Double but Int was expected>
candidate = 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 = {}
isInBestCandidates = false
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<TYPE_MISMATCH: Type mismatch: inferred type is Double but Long was expected>
candidate = 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 = {}
isInBestCandidates = false
@@ -0,0 +1,17 @@
KtApplicableCallCandidateInfo:
candidate = KtSimpleFunctionCall:
isImplicitInvoke = true
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = f
isSafeNavigation = false
extensionReceiver = KtExplicitReceiverValue:
expression = ""
isSafeNavigation = false
signature = KtFunctionLikeSignature:
receiverType = kotlin.String
returnType = kotlin.Unit
symbol = kotlin/Function1.invoke(<extension receiver>: P1<dispatch receiver>: kotlin.Function1<P1, R>): R
valueParameters = []
argumentMapping = {}
isInBestCandidates = true
@@ -0,0 +1,17 @@
KtApplicableCallCandidateInfo:
candidate = KtSimpleFunctionCall:
isImplicitInvoke = true
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = f
isSafeNavigation = false
extensionReceiver = KtExplicitReceiverValue:
expression = ""
isSafeNavigation = false
signature = KtFunctionLikeSignature:
receiverType = kotlin.String
returnType = kotlin.Unit
symbol = kotlin/Function1.invoke(<extension receiver>: P1<dispatch receiver>: kotlin.Function1<P1, R>): R
valueParameters = []
argumentMapping = {}
isInBestCandidates = true
@@ -0,0 +1,38 @@
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<TOO_MANY_ARGUMENTS: Too many arguments for public final operator fun get(a: Int, b: String): Boolean defined in C>
candidate = 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:
name = a
receiverType = null
returnType = kotlin.Int
symbol = a: kotlin.Int,
KtVariableLikeSignature:
name = b
receiverType = null
returnType = kotlin.String
symbol = b: kotlin.String
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
name = a
receiverType = null
returnType = kotlin.Int
symbol = a: kotlin.Int),
"foo" -> (KtVariableLikeSignature:
name = b
receiverType = null
returnType = kotlin.String
symbol = b: kotlin.String)
}
isInBestCandidates = true
@@ -0,0 +1,48 @@
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<CONSTANT_EXPECTED_TYPE_MISMATCH: The floating-point literal does not conform to the expected type Boolean>
candidate = KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = c
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /C.set(<dispatch receiver>: C, a: kotlin.Int, b: kotlin.String, value: kotlin.Boolean): kotlin.Unit
valueParameters = [
KtVariableLikeSignature:
name = a
receiverType = null
returnType = kotlin.Int
symbol = a: kotlin.Int,
KtVariableLikeSignature:
name = b
receiverType = null
returnType = kotlin.String
symbol = b: kotlin.String,
KtVariableLikeSignature:
name = value
receiverType = null
returnType = kotlin.Boolean
symbol = value: kotlin.Boolean
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
name = a
receiverType = null
returnType = kotlin.Int
symbol = a: kotlin.Int),
"foo" -> (KtVariableLikeSignature:
name = b
receiverType = null
returnType = kotlin.String
symbol = b: kotlin.String),
3.14 -> (KtVariableLikeSignature:
name = value
receiverType = null
returnType = kotlin.Boolean
symbol = value: kotlin.Boolean)
}
isInBestCandidates = true
@@ -0,0 +1,16 @@
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<INVISIBLE_MEMBER: Cannot access 'foo': it is private in 'A'>
candidate = KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = a
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /A.foo(<dispatch receiver>: A): kotlin.Unit
valueParameters = []
argumentMapping = {}
isInBestCandidates = true
@@ -0,0 +1,14 @@
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<TOO_MANY_ARGUMENTS: Too many arguments for public fun foo(): Unit defined in root package in file simpleCallWithNonMatchingArgs.kt>
candidate = KtSimpleFunctionCall:
isImplicitInvoke = false
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = /foo(): kotlin.Unit
valueParameters = []
argumentMapping = {}
isInBestCandidates = true
@@ -0,0 +1,37 @@
KtApplicableCallCandidateInfo:
candidate = KtSimpleFunctionCall:
isImplicitInvoke = true
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = KtExplicitReceiverValue:
expression = x
isSafeNavigation = false
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = kotlin.Unit
symbol = kotlin/Function2.invoke(<dispatch receiver>: kotlin.Function2<P1, P2, R>, p1: P1, p2: P2): R
valueParameters = [
KtVariableLikeSignature:
name = a
receiverType = null
returnType = @R|kotlin.ParameterName|(name = String(a)) @R|kotlin.ParameterName|(name = String(notMe)) kotlin.Int
symbol = p1: P1,
KtVariableLikeSignature:
name = b
receiverType = null
returnType = @R|kotlin.ParameterName|(name = String(b)) @R|kotlin.ParameterName|(name = String(meNeither)) kotlin.String
symbol = p2: P2
]
argumentMapping = {
1 -> (KtVariableLikeSignature:
name = a
receiverType = null
returnType = @R|kotlin.ParameterName|(name = String(a)) @R|kotlin.ParameterName|(name = String(notMe)) kotlin.Int
symbol = p1: P1),
"" -> (KtVariableLikeSignature:
name = b
receiverType = null
returnType = @R|kotlin.ParameterName|(name = String(b)) @R|kotlin.ParameterName|(name = String(meNeither)) kotlin.String
symbol = p2: P2)
}
isInBestCandidates = true