K2: drop state mutation from ResolvedLambdaAtom init block

Related to KT-61933
This commit is contained in:
Mikhail Glukhikh
2023-09-20 13:57:50 +02:00
committed by Space Team
parent 770bbd8f6b
commit eb3f785c36
3 changed files with 6 additions and 10 deletions
@@ -117,7 +117,8 @@ fun extractLambdaInfoFromFunctionType(
parameters, parameters,
returnType, returnType,
typeVariableForLambdaReturnType = returnTypeVariable, typeVariableForLambdaReturnType = returnTypeVariable,
candidate,
coerceFirstParameterToExtensionReceiver coerceFirstParameterToExtensionReceiver
) ).also {
candidate?.postponedAtoms?.add(it)
}
} }
@@ -145,7 +145,8 @@ private fun extractLambdaInfo(
parameters, parameters,
returnType, returnType,
typeVariable.takeIf { newTypeVariableUsed }, typeVariable.takeIf { newTypeVariableUsed },
candidate,
coerceFirstParameterToExtensionReceiver = false coerceFirstParameterToExtensionReceiver = false
) ).also {
candidate?.postponedAtoms?.add(it)
}
} }
@@ -46,14 +46,8 @@ class ResolvedLambdaAtom(
val parameters: List<ConeKotlinType>, val parameters: List<ConeKotlinType>,
var returnType: ConeKotlinType, var returnType: ConeKotlinType,
typeVariableForLambdaReturnType: ConeTypeVariableForLambdaReturnType?, typeVariableForLambdaReturnType: ConeTypeVariableForLambdaReturnType?,
candidateOfOuterCall: Candidate?,
val coerceFirstParameterToExtensionReceiver: Boolean val coerceFirstParameterToExtensionReceiver: Boolean
) : PostponedResolvedAtom() { ) : PostponedResolvedAtom() {
init {
candidateOfOuterCall?.let {
it.postponedAtoms += this
}
}
var typeVariableForLambdaReturnType = typeVariableForLambdaReturnType var typeVariableForLambdaReturnType = typeVariableForLambdaReturnType
private set private set