[Constraint solver] Lazily handle conformance-related constraints.

The code was already there for them; make sure we use it
consistently.
This commit is contained in:
Doug Gregor
2016-10-21 16:12:11 -07:00
parent 8451536e89
commit af4d44e013

View File

@@ -4138,6 +4138,12 @@ ConstraintSystem::addConstraintImpl(ConstraintKind kind, Type first,
case ConstraintKind::DynamicTypeOf:
return simplifyDynamicTypeOfConstraint(first, second, subflags, locator);
case ConstraintKind::ConformsTo:
case ConstraintKind::LiteralConformsTo:
case ConstraintKind::SelfObjectOfProtocol:
return simplifyConformsToConstraint(first, second, kind, locator,
subflags);
case ConstraintKind::Bind: // FIXME: This should go through matchTypes() above
default: {
@@ -4149,6 +4155,12 @@ ConstraintSystem::addConstraintImpl(ConstraintKind kind, Type first,
addConstraint(c);
return SolutionKind::Solved;
}
case ConstraintKind::ValueMember:
case ConstraintKind::UnresolvedValueMember:
case ConstraintKind::TypeMember:
case ConstraintKind::BindOverload:
llvm_unreachable("Use the correct addConstraint()");
}
}