Skip to content

Commit b920c02

Browse files
authored
Merge pull request #19203 from xedin/iterative-solver
[ConstraintSystem] Implementation of the iterative constraint solver
2 parents fbd21e1 + bec3d28 commit b920c02

File tree

8 files changed

+1339
-702
lines changed

8 files changed

+1339
-702
lines changed

lib/Sema/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ add_swift_library(swiftSema STATIC
1111
CSRanking.cpp
1212
CSSimplify.cpp
1313
CSSolver.cpp
14+
CSStep.cpp
1415
CSFix.cpp
1516
CSDiagnostics.cpp
1617
CalleeCandidateInfo.cpp

lib/Sema/CSBindings.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ bool TypeVarBindingProducer::computeNext() {
849849
return true;
850850
}
851851

852-
void TypeVariableBinding::attempt(ConstraintSystem &cs) const {
852+
bool TypeVariableBinding::attempt(ConstraintSystem &cs) const {
853853
auto type = Binding.BindingType;
854854
auto *locator = TypeVar->getImpl().getLocator();
855855

@@ -878,4 +878,6 @@ void TypeVariableBinding::attempt(ConstraintSystem &cs) const {
878878
// If this was from a defaultable binding note that.
879879
if (Binding.isDefaultableBinding())
880880
cs.DefaultedConstraints.push_back(Binding.DefaultableBinding);
881+
882+
return !cs.failedConstraint && !cs.simplify();
881883
}

0 commit comments

Comments
 (0)