Conflict resolution and conversion to ConstraintFix class

This commit is contained in:
gregomni
2018-08-16 18:21:43 -07:00
parent 9e0dae513c
commit eaf8c6d232
3 changed files with 31 additions and 2 deletions

View File

@@ -2446,7 +2446,8 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
AddAddressOf::create(*this, getConstraintLocator(locator)));
} else if (!isTypeVarOrMember1) {
// If we have a concrete type that's an rvalue, "fix" it.
conversionsOrFixes.push_back(FixKind::TreatRValueAsLValue);
conversionsOrFixes.push_back(
TreatRValueAsLValue::create(*this, getConstraintLocator(locator)));
}
}
}
@@ -4990,7 +4991,7 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyFixConstraint(
auto result = matchTypes(LValueType::get(type1), type2,
matchKind, subflags, locator);
if (result == SolutionKind::Solved)
if (recordFix(fix, locator))
if (recordFix(fix))
return SolutionKind::Error;
return result;