[tests] Adjusting SR-12869 test cases for optional mismatches

This commit is contained in:
Luciano Almeida
2020-05-24 16:09:19 -03:00
parent 086ad339c9
commit 2e1609e533
2 changed files with 12 additions and 6 deletions

View File

@@ -3367,8 +3367,7 @@ bool ConstraintSystem::repairFailures(
conversionsOrFixes.push_back(
IgnoreAssignmentDestinationType::create(*this, lhs, rhs, loc));
} else {
conversionsOrFixes.push_back(
TreatRValueAsLValue::create(*this, loc));
conversionsOrFixes.push_back(TreatRValueAsLValue::create(*this, loc));
}
return true;
@@ -8876,11 +8875,11 @@ ConstraintSystem::simplifyRestrictedConstraintImpl(
// tuple mismatch.
if (hasFixFor(loc, FixKind::AllowTupleTypeMismatch))
return true;
if (restriction == ConversionRestrictionKind::ValueToOptional ||
restriction == ConversionRestrictionKind::OptionalToOptional)
++impact;
auto *fix =
loc->isLastElement<LocatorPathElt::ApplyArgToParam>()
? AllowArgumentMismatch::create(*this, fromType, toType, loc)