From af4d44e0138c16a64f8319e68f47e16fb6afa01f Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Fri, 21 Oct 2016 16:12:11 -0700 Subject: [PATCH] [Constraint solver] Lazily handle conformance-related constraints. The code was already there for them; make sure we use it consistently. --- lib/Sema/CSSimplify.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/Sema/CSSimplify.cpp b/lib/Sema/CSSimplify.cpp index acc9e03cfe3..609cd47aab2 100644 --- a/lib/Sema/CSSimplify.cpp +++ b/lib/Sema/CSSimplify.cpp @@ -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()"); } }