mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Record closure types in the trail
This commit is contained in:
@@ -247,6 +247,14 @@ SolverTrail::Change::AppliedPropertyWrapper(Expr *expr) {
|
||||
return result;
|
||||
}
|
||||
|
||||
SolverTrail::Change
|
||||
SolverTrail::Change::RecordedClosureType(const ClosureExpr *closure) {
|
||||
Change result;
|
||||
result.Kind = ChangeKind::RecordedClosureType;
|
||||
result.Closure = closure;
|
||||
return result;
|
||||
}
|
||||
|
||||
void SolverTrail::Change::undo(ConstraintSystem &cs) const {
|
||||
auto &cg = cs.getConstraintGraph();
|
||||
|
||||
@@ -364,6 +372,10 @@ void SolverTrail::Change::undo(ConstraintSystem &cs) const {
|
||||
case ChangeKind::ResolvedOverload:
|
||||
cs.removeResolvedOverload(Locator);
|
||||
break;
|
||||
|
||||
case ChangeKind::RecordedClosureType:
|
||||
cs.removeClosureType(Closure);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -551,6 +563,12 @@ void SolverTrail::Change::dump(llvm::raw_ostream &out,
|
||||
simple_display(out, TheExpr);
|
||||
out << ")\n";
|
||||
break;
|
||||
|
||||
case ChangeKind::RecordedClosureType:
|
||||
out << "(RecordedClosureType ";
|
||||
simple_display(out, Closure);
|
||||
out << ")\n";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user