Sema: Remove BindingSet::getConstraintSystem()

We shouldn't store a pointer to the ConstraintSystem inside every
BindingSet, but there are some annoying things to untangle before
we can do that.

As a starting point toward that, remove the getConstraintSystem()
getter so that at least we can't reach up to the ConstraintSystem
from the outside.
This commit is contained in:
Slava Pestov
2025-12-13 14:49:30 -05:00
parent 77ee3dab7d
commit d795c185b5
6 changed files with 18 additions and 13 deletions

View File

@@ -352,7 +352,7 @@ TEST_F(SemaTest, TestNoDoubleVoidClosureResultInference) {
auto verifyInference = [&](TypeVariableType *typeVar, unsigned numExpected) {
auto bindings = cs.getBindingsFor(typeVar);
TypeVarBindingProducer producer(bindings);
TypeVarBindingProducer producer(cs, typeVar, bindings);
llvm::SmallPtrSet<Type, 2> inferredTypes;
@@ -425,7 +425,7 @@ TEST_F(SemaTest, TestSupertypeInferenceWithDefaults) {
cs.getConstraintLocator({}));
auto bindings = cs.getBindingsFor(genericArg);
TypeVarBindingProducer producer(bindings);
TypeVarBindingProducer producer(cs, genericArg, bindings);
llvm::SmallVector<Type, 4> inferredTypes;
while (auto binding = producer()) {