[FIR] Build resolved argument list for augmented array assignment get call
This lets us get rid of some fallback code in FIR2IR that handles unresolved argument lists. After this, we should have an invariant that all non-empty argument lists are resolved when FIR2IR runs. #KT-66124
This commit is contained in:
committed by
Space Team
parent
8443daf78d
commit
454ef4ae46
+16
-14
@@ -1635,23 +1635,25 @@ open class FirExpressionsResolveTransformer(transformer: FirAbstractBodyResolveT
|
||||
dispatchReceiver = lhsGetCall.dispatchReceiver
|
||||
}
|
||||
calleeReference = lhsGetCall.calleeReference
|
||||
argumentList = buildArgumentList {
|
||||
var i = 0
|
||||
for (argument in lhsGetCall.argumentList.arguments) {
|
||||
arguments += if (argument is FirVarargArgumentsExpression) {
|
||||
buildVarargArgumentsExpression {
|
||||
val varargSize = argument.arguments.size
|
||||
arguments += indicesQualifiedAccessForGet.subList(i, i + varargSize)
|
||||
i += varargSize
|
||||
source = argument.source
|
||||
coneTypeOrNull = argument.resolvedType
|
||||
coneElementTypeOrNull = argument.coneElementTypeOrNull
|
||||
}
|
||||
} else {
|
||||
indicesQualifiedAccessForGet[i++]
|
||||
var i = 0
|
||||
val newMapping = (lhsGetCall.argumentList as FirResolvedArgumentList).mapping.mapKeysTo(LinkedHashMap()) { (argument) ->
|
||||
if (argument is FirVarargArgumentsExpression) {
|
||||
buildVarargArgumentsExpression {
|
||||
val varargSize = argument.arguments.size
|
||||
arguments += indicesQualifiedAccessForGet.subList(i, i + varargSize)
|
||||
i += varargSize
|
||||
source = argument.source
|
||||
coneTypeOrNull = argument.resolvedType
|
||||
coneElementTypeOrNull = argument.coneElementTypeOrNull
|
||||
}
|
||||
} else {
|
||||
indicesQualifiedAccessForGet[i++]
|
||||
}
|
||||
}
|
||||
argumentList = buildResolvedArgumentList(
|
||||
lhsGetCall.argumentList,
|
||||
newMapping,
|
||||
)
|
||||
origin = FirFunctionCallOrigin.Operator
|
||||
coneTypeOrNull = lhsGetCall.resolvedType
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user