Skip to content

Commit af4d44e

Browse files
committed
[Constraint solver] Lazily handle conformance-related constraints.
The code was already there for them; make sure we use it consistently.
1 parent 8451536 commit af4d44e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4138,6 +4138,12 @@ ConstraintSystem::addConstraintImpl(ConstraintKind kind, Type first,
41384138
case ConstraintKind::DynamicTypeOf:
41394139
return simplifyDynamicTypeOfConstraint(first, second, subflags, locator);
41404140

4141+
case ConstraintKind::ConformsTo:
4142+
case ConstraintKind::LiteralConformsTo:
4143+
case ConstraintKind::SelfObjectOfProtocol:
4144+
return simplifyConformsToConstraint(first, second, kind, locator,
4145+
subflags);
4146+
41414147
case ConstraintKind::Bind: // FIXME: This should go through matchTypes() above
41424148

41434149
default: {
@@ -4149,6 +4155,12 @@ ConstraintSystem::addConstraintImpl(ConstraintKind kind, Type first,
41494155
addConstraint(c);
41504156
return SolutionKind::Solved;
41514157
}
4158+
4159+
case ConstraintKind::ValueMember:
4160+
case ConstraintKind::UnresolvedValueMember:
4161+
case ConstraintKind::TypeMember:
4162+
case ConstraintKind::BindOverload:
4163+
llvm_unreachable("Use the correct addConstraint()");
41524164
}
41534165
}
41544166

0 commit comments

Comments
 (0)