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,
returnType,
typeVariableForLambdaReturnType = returnTypeVariable,
candidate,
coerceFirstParameterToExtensionReceiver
)
).also {
candidate?.postponedAtoms?.add(it)
}
}
@@ -145,7 +145,8 @@ private fun extractLambdaInfo(
parameters,
returnType,
typeVariable.takeIf { newTypeVariableUsed },
candidate,
coerceFirstParameterToExtensionReceiver = false
)
).also {
candidate?.postponedAtoms?.add(it)
}
}
@@ -46,14 +46,8 @@ class ResolvedLambdaAtom(
val parameters: List<ConeKotlinType>,
var returnType: ConeKotlinType,
typeVariableForLambdaReturnType: ConeTypeVariableForLambdaReturnType?,
candidateOfOuterCall: Candidate?,
val coerceFirstParameterToExtensionReceiver: Boolean
) : PostponedResolvedAtom() {
init {
candidateOfOuterCall?.let {
it.postponedAtoms += this
}
}
var typeVariableForLambdaReturnType = typeVariableForLambdaReturnType
private set