Skip to content

Commit 7a48da9

Browse files
committed
Builds
1 parent aed37e9 commit 7a48da9

File tree

4 files changed

+47
-482
lines changed

4 files changed

+47
-482
lines changed

src/Draco.Compiler/Internal/Solver/ConstraintSolver.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,13 @@ public Argument Arg(SyntaxNode? syntax, BindingTask<BoundLvalue> lvalue, Diagnos
6868
/// <param name="diagnostics">The bag to report diagnostics to.</param>
6969
public void Solve(DiagnosticBag diagnostics)
7070
{
71-
var solver = new DefinitionOrderSolver(this.ConstructRules(diagnostics));
72-
solver.Solve(this.constraintStore);
71+
while (this.ApplyRulesOnce()) { }
7372

7473
// Check for uninferred locals
7574
this.CheckForUninferredLocals(diagnostics);
7675

7776
// And for failed inference
78-
this.CheckForIncompleteInference(diagnostics, solver);
77+
this.CheckForIncompleteInference(diagnostics);
7978
}
8079

8180
private void CheckForUninferredLocals(DiagnosticBag diagnostics)
@@ -94,7 +93,7 @@ private void CheckForUninferredLocals(DiagnosticBag diagnostics)
9493
}
9594
}
9695

97-
private void CheckForIncompleteInference(DiagnosticBag diagnostics, IChrSolver solver)
96+
private void CheckForIncompleteInference(DiagnosticBag diagnostics)
9897
{
9998
var inferenceFailed = this.constraintStore.Count > 0
10099
|| this.typeVariables.Select(t => t.Substitution).Any(t => t.IsTypeVariable);
@@ -106,7 +105,7 @@ private void CheckForIncompleteInference(DiagnosticBag diagnostics, IChrSolver s
106105
location: InferDiagnosticTargetSyntax(this.Context.DeclaringSyntax)?.Location,
107106
formatArgs: this.ContextName));
108107

109-
this.FailRemainingRules(solver);
108+
this.FailRemainingRules();
110109
}
111110

112111
/// <summary>

0 commit comments

Comments
 (0)