From 5b4e8170aea09d49a77e5c7b7be0fdfe58ea3e89 Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Mon, 2 Dec 2019 17:03:28 +0300 Subject: [PATCH] Fix variables leaking when adding other system under transaction --- .../resolve/calls/inference/model/NewConstraintSystemImpl.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/model/NewConstraintSystemImpl.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/model/NewConstraintSystemImpl.kt index f7009be4542..783f5581f30 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/model/NewConstraintSystemImpl.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/model/NewConstraintSystemImpl.kt @@ -165,6 +165,9 @@ class NewConstraintSystemImpl( } override fun addOtherSystem(otherSystem: ConstraintStorage) { + otherSystem.allTypeVariables.forEach { + transactionRegisterVariable(it.value) + } storage.allTypeVariables.putAll(otherSystem.allTypeVariables) for ((variable, constraints) in otherSystem.notFixedTypeVariables) { notFixedTypeVariables[variable] = MutableVariableWithConstraints(constraints.typeVariable, constraints.constraints)