mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ConstraintSystem] Compute variables referenced by conjunction elements incrementally
Attempting to pre-compute a set of referenced type variables upfront is incorrect because parameter(s) and/or result type could be bound before conjunction is attempted. Let's compute a set of referenced variables before each element gets attempted.
This commit is contained in:
@@ -799,10 +799,6 @@ bool ConjunctionStep::attempt(const ConjunctionElement &element) {
|
||||
CS.applySolution(Solutions.pop_back_val());
|
||||
}
|
||||
|
||||
// Bring all of the referenced variables into scope.
|
||||
for (auto *typeVar : element.getReferencedVars())
|
||||
CS.addTypeVariable(typeVar);
|
||||
|
||||
// Make sure that element is solved in isolation
|
||||
// by dropping all scoring information.
|
||||
CS.CurrentScore = Score();
|
||||
|
||||
Reference in New Issue
Block a user