Revert "Fix the build."

This reverts commit dc24c2bd34.

Turns out Chris fixed the build but when I was looking at the bots, his fix had
not been tested yet, so I thought the tree was still red and was trying to
revert to green.
This commit is contained in:
Michael Gottesman
2016-07-17 16:28:48 -07:00
parent dc24c2bd34
commit a047bb7564
26 changed files with 103 additions and 339 deletions

View File

@@ -2307,12 +2307,7 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyConformsToConstraint(
// See if there's anything we can do to fix the conformance:
OptionalTypeKind optionalKind;
if (auto optionalObjectType = type->getAnyOptionalObjectType(optionalKind)) {
if (protocol->isSpecificProtocol(KnownProtocolKind::Boolean)) {
// Optionals don't conform to Boolean; suggest '!= nil'.
if (recordFix(FixKind::OptionalToBoolean, getConstraintLocator(locator)))
return SolutionKind::Error;
return SolutionKind::Solved;
} else if (optionalKind == OTK_Optional) {
if (optionalKind == OTK_Optional) {
// The underlying type of an optional may conform to the protocol if the
// optional doesn't; suggest forcing if that's the case.
auto result = simplifyConformsToConstraint(
@@ -4231,10 +4226,6 @@ ConstraintSystem::simplifyFixConstraint(Fix fix, Type type1, Type type2,
return matchTypes(InOutType::get(type1->getRValueType()), type2,
matchKind, subFlags, locator);
case FixKind::OptionalToBoolean:
// The actual semantics are handled elsewhere.
return SolutionKind::Solved;
case FixKind::CoerceToCheckedCast:
llvm_unreachable("handled elsewhere");
}