[Analysis API FIR] fix candidate collection for delegatedConstructor call

^KTIJ-20446
This commit is contained in:
Ilya Kirillov
2022-07-20 19:20:49 +02:00
parent 2c48d25c96
commit a0f0fa5a47
19 changed files with 457 additions and 39 deletions
@@ -0,0 +1,4 @@
open class A(x: Int) {
}
class B(): <expr>A</expr>(5)
@@ -0,0 +1,29 @@
KtApplicableCallCandidateInfo:
candidate = KtDelegatedConstructorCall:
kind = SUPER_CALL
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = A
symbol = <constructor>(x: kotlin.Int): A
valueParameters = [
KtVariableLikeSignature:
name = x
receiverType = null
returnType = kotlin.Int
symbol = x: kotlin.Int
callableIdIfNonLocal = null
]
callableIdIfNonLocal = null
typeArgumentsMapping = {}
argumentMapping = {
5 -> (KtVariableLikeSignature:
name = x
receiverType = null
returnType = kotlin.Int
symbol = x: kotlin.Int
callableIdIfNonLocal = null)
}
isInBestCandidates = true
@@ -0,0 +1,30 @@
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<null: OTHER_ERROR with <init>>
candidate = KtDelegatedConstructorCall:
kind = SUPER_CALL
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = A
symbol = <constructor>(x: kotlin.String): A
valueParameters = [
KtVariableLikeSignature:
name = x
receiverType = null
returnType = kotlin.String
symbol = x: kotlin.String
callableIdIfNonLocal = null
]
callableIdIfNonLocal = null
typeArgumentsMapping = {}
argumentMapping = {
5 -> (KtVariableLikeSignature:
name = x
receiverType = null
returnType = kotlin.String
symbol = x: kotlin.String
callableIdIfNonLocal = null)
}
isInBestCandidates = true
@@ -0,0 +1,4 @@
open class A(x: String) {
}
class B(): <expr>A</expr>(5)
@@ -0,0 +1,30 @@
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<ARGUMENT_TYPE_MISMATCH: Argument type mismatch: actual type is kotlin/Int but kotlin/String was expected>
candidate = KtDelegatedConstructorCall:
kind = SUPER_CALL
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = A
symbol = <constructor>(x: kotlin.String): A
valueParameters = [
KtVariableLikeSignature:
name = x
receiverType = null
returnType = kotlin.String
symbol = x: kotlin.String
callableIdIfNonLocal = null
]
callableIdIfNonLocal = null
typeArgumentsMapping = {}
argumentMapping = {
5 -> (KtVariableLikeSignature:
name = x
receiverType = null
returnType = kotlin.String
symbol = x: kotlin.String
callableIdIfNonLocal = null)
}
isInBestCandidates = true
@@ -0,0 +1,16 @@
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<null: OTHER_ERROR with <init>>
candidate = KtDelegatedConstructorCall:
kind = SUPER_CALL
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = A
symbol = <constructor>(): A
valueParameters = []
callableIdIfNonLocal = null
typeArgumentsMapping = {}
argumentMapping = {}
isInBestCandidates = true
@@ -0,0 +1,4 @@
open class A() {
}
class B(): <expr>A</expr>(5)
@@ -0,0 +1,16 @@
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<TOO_MANY_ARGUMENTS: Too many arguments for public constructor(): R|A|>
candidate = KtDelegatedConstructorCall:
kind = SUPER_CALL
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
dispatchReceiver = null
extensionReceiver = null
signature = KtFunctionLikeSignature:
receiverType = null
returnType = A
symbol = <constructor>(): A
valueParameters = []
callableIdIfNonLocal = null
typeArgumentsMapping = {}
argumentMapping = {}
isInBestCandidates = true