mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Record opened existential types in the trail
This commit is contained in:
@@ -185,6 +185,14 @@ SolverTrail::Change::recordedOpenedTypes(ConstraintLocator *locator) {
|
||||
return result;
|
||||
}
|
||||
|
||||
SolverTrail::Change
|
||||
SolverTrail::Change::recordedOpenedExistentialType(ConstraintLocator *locator) {
|
||||
Change result;
|
||||
result.Kind = ChangeKind::RecordedOpenedExistentialType;
|
||||
result.Locator = locator;
|
||||
return result;
|
||||
}
|
||||
|
||||
void SolverTrail::Change::undo(ConstraintSystem &cs) const {
|
||||
auto &cg = cs.getConstraintGraph();
|
||||
|
||||
@@ -253,6 +261,10 @@ void SolverTrail::Change::undo(ConstraintSystem &cs) const {
|
||||
case ChangeKind::RecordedOpenedTypes:
|
||||
cs.removeOpenedType(Locator);
|
||||
break;
|
||||
|
||||
case ChangeKind::RecordedOpenedExistentialType:
|
||||
cs.removeOpenedExistentialType(Locator);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -388,6 +400,12 @@ void SolverTrail::Change::dump(llvm::raw_ostream &out,
|
||||
Locator->dump(&cs.getASTContext().SourceMgr, out);
|
||||
out << ")\n";
|
||||
break;
|
||||
|
||||
case ChangeKind::RecordedOpenedExistentialType:
|
||||
out << "(recorded opened existential type at ";
|
||||
Locator->dump(&cs.getASTContext().SourceMgr, out);
|
||||
out << ")\n";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user