Merge remote-tracking branch 'origin/master' into master-next

This commit is contained in:
Arnold Schwaighofer
2019-08-28 06:50:47 -07:00
63 changed files with 1045 additions and 579 deletions

View File

@@ -125,12 +125,6 @@ Solution ConstraintSystem::finalize() {
}
solution.Fixes.append(Fixes.begin() + firstFixIndex, Fixes.end());
// Remember all of the missing member references encountered,
// that helps diagnostics to avoid emitting error for each
// member in the chain.
for (auto *member : MissingMembers)
solution.MissingMembers.push_back(member);
// Remember all the disjunction choices we made.
for (auto &choice : DisjunctionChoices) {
// We shouldn't ever register disjunction choices multiple times,
@@ -267,10 +261,6 @@ void ConstraintSystem::applySolution(const Solution &solution) {
// Register any fixes produced along this path.
Fixes.append(solution.Fixes.begin(), solution.Fixes.end());
// Register any missing members encountered along this path.
MissingMembers.insert(solution.MissingMembers.begin(),
solution.MissingMembers.end());
}
/// Restore the type variable bindings to what they were before
@@ -452,6 +442,7 @@ ConstraintSystem::SolverScope::SolverScope(ConstraintSystem &cs)
numSavedBindings = cs.solverState->savedBindings.size();
numConstraintRestrictions = cs.ConstraintRestrictions.size();
numFixes = cs.Fixes.size();
numHoles = cs.Holes.size();
numFixedRequirements = cs.FixedRequirements.size();
numDisjunctionChoices = cs.DisjunctionChoices.size();
numOpenedTypes = cs.OpenedTypes.size();
@@ -459,7 +450,6 @@ ConstraintSystem::SolverScope::SolverScope(ConstraintSystem &cs)
numDefaultedConstraints = cs.DefaultedConstraints.size();
numAddedNodeTypes = cs.addedNodeTypes.size();
numCheckedConformances = cs.CheckedConformances.size();
numMissingMembers = cs.MissingMembers.size();
numDisabledConstraints = cs.solverState->getNumDisabledConstraints();
numFavoredConstraints = cs.solverState->getNumFavoredConstraints();
numBuilderTransformedClosures = cs.builderTransformedClosures.size();
@@ -500,6 +490,9 @@ ConstraintSystem::SolverScope::~SolverScope() {
// Remove any fixes.
truncate(cs.Fixes, numFixes);
// Remove any holes encountered along the current path.
truncate(cs.Holes, numHoles);
// Remove any disjunction choices.
truncate(cs.DisjunctionChoices, numDisjunctionChoices);
@@ -525,9 +518,6 @@ ConstraintSystem::SolverScope::~SolverScope() {
// Remove any conformances checked along the current path.
truncate(cs.CheckedConformances, numCheckedConformances);
// Remove any missing members found along the current path.
truncate(cs.MissingMembers, numMissingMembers);
/// Remove any builder transformed closures.
truncate(cs.builderTransformedClosures, numBuilderTransformedClosures);