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)
|
checkState(State.BUILDING, State.COMPLETION, State.TRANSACTION)
|
||||||
|
|
||||||
transactionRegisterVariable(variable)
|
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()
|
notProperTypesCache.clear()
|
||||||
storage.notFixedTypeVariables[variable.freshTypeConstructor()] = MutableVariableWithConstraints(this, variable)
|
storage.notFixedTypeVariables[variable.freshTypeConstructor()] = MutableVariableWithConstraints(this, variable)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user