Make constraint system fail hard on registering existing variable
This commit is contained in:
+2
-1
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user