Analysis API: Fix issues related to implicit invoke calls:
- Correctly set explicit receiver value. - Restore original function call from FirImplicitFunctionCall (i.e., calls implicitly resolved to `invoke`) to get the correct name for getting all candidates. - Collect candidates at all tower levels. Also make order of candidate calls in tests deterministic.
This commit is contained in:
committed by
Ilya Kirillov
parent
ace826c570
commit
9b9da94a09
+44
@@ -0,0 +1,44 @@
|
||||
KtErrorCallInfo:
|
||||
candidateCalls = [
|
||||
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, a: kotlin.String): kotlin.Unit
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
name = a
|
||||
receiverType = null
|
||||
returnType = kotlin.String
|
||||
symbol = a: kotlin.String
|
||||
]
|
||||
argumentMapping = {},
|
||||
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, b: kotlin.Boolean): kotlin.Unit
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
name = b
|
||||
receiverType = null
|
||||
returnType = kotlin.Boolean
|
||||
symbol = b: kotlin.Boolean
|
||||
]
|
||||
argumentMapping = {}
|
||||
]
|
||||
diagnostic = ERROR<NONE_APPLICABLE: None of the following functions can be called with the arguments supplied:
|
||||
local final operator fun Int.invoke(b: Boolean): Unit defined in call
|
||||
local final operator fun Int.invoke(a: String): Unit defined in call>
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
fun x(c: Char) {}
|
||||
|
||||
fun call(x: kotlin.Int) {
|
||||
operator fun Int.invoke(a: String) {}
|
||||
operator fun Int.invoke(b: Boolean) {}
|
||||
<expr>x()</expr>
|
||||
}
|
||||
Vendored
+42
@@ -0,0 +1,42 @@
|
||||
KtErrorCallInfo:
|
||||
candidateCalls = [
|
||||
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, a: kotlin.String): kotlin.Unit
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
name = a
|
||||
receiverType = null
|
||||
returnType = kotlin.String
|
||||
symbol = a: kotlin.String
|
||||
]
|
||||
argumentMapping = {},
|
||||
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, b: kotlin.Boolean): kotlin.Unit
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
name = b
|
||||
receiverType = null
|
||||
returnType = kotlin.Boolean
|
||||
symbol = b: kotlin.Boolean
|
||||
]
|
||||
argumentMapping = {}
|
||||
]
|
||||
diagnostic = ERROR<NONE_APPLICABLE: None of the following functions are applicable: [<local>/invoke, <local>/invoke]>
|
||||
+17
-17
@@ -1,22 +1,5 @@
|
||||
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:
|
||||
name = p
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = p: kotlin.Int
|
||||
]
|
||||
argumentMapping = {},
|
||||
KtDelegatedConstructorCall:
|
||||
kind = THIS_CALL
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
@@ -38,6 +21,23 @@ KtErrorCallInfo:
|
||||
returnType = kotlin.Int
|
||||
symbol = j: kotlin.Int
|
||||
]
|
||||
argumentMapping = {},
|
||||
KtDelegatedConstructorCall:
|
||||
kind = THIS_CALL
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = Sub
|
||||
symbol = <constructor>(p: kotlin.Int): Sub
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
name = p
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = p: kotlin.Int
|
||||
]
|
||||
argumentMapping = {}
|
||||
]
|
||||
diagnostic = ERROR<NONE_APPLICABLE: None of the following functions are applicable: [/Sub.Sub, /Sub.Sub]>
|
||||
|
||||
Reference in New Issue
Block a user