diff --git a/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/inference/model/NewConstraintSystemImpl.kt b/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/inference/model/NewConstraintSystemImpl.kt index 94b4c10bf27..d6ea7cae4a9 100644 --- a/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/inference/model/NewConstraintSystemImpl.kt +++ b/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/inference/model/NewConstraintSystemImpl.kt @@ -115,7 +115,8 @@ class NewConstraintSystemImpl( checkState(State.BUILDING, State.COMPLETION, State.TRANSACTION) transactionRegisterVariable(variable) - storage.allTypeVariables[variable.freshTypeConstructor()] = variable + storage.allTypeVariables.put(variable.freshTypeConstructor(), variable) + ?.let { error("Type variable already registered: old: $it, new: $variable") } notProperTypesCache.clear() storage.notFixedTypeVariables[variable.freshTypeConstructor()] = MutableVariableWithConstraints(this, variable) }