K2: drop state mutation from LambdaWithTypeVariableAsExpectedTypeAtom init block

Related to KT-61933
This commit is contained in:
Mikhail Glukhikh
2023-09-19 11:03:42 +02:00
committed by Space Team
parent 14bc20652e
commit 770bbd8f6b
2 changed files with 3 additions and 4 deletions
@@ -42,7 +42,9 @@ fun Candidate.preprocessLambdaArgument(
}?.type as ConeKotlinType?
if (explicitTypeArgument == null || explicitTypeArgument.typeArguments.isNotEmpty()) {
return LambdaWithTypeVariableAsExpectedTypeAtom(argument, expectedType, this)
return LambdaWithTypeVariableAsExpectedTypeAtom(argument, expectedType, this).also {
this.postponedAtoms += it
}
}
}
}
@@ -90,9 +90,6 @@ class LambdaWithTypeVariableAsExpectedTypeAtom(
private val initialExpectedTypeType: ConeKotlinType,
val candidateOfOuterCall: Candidate,
) : PostponedResolvedAtom(), LambdaWithTypeVariableAsExpectedTypeMarker {
init {
candidateOfOuterCall.postponedAtoms += this
}
override var parameterTypesFromDeclaration: List<ConeKotlinType?>? = null
private set