mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -4138,6 +4138,12 @@ ConstraintSystem::addConstraintImpl(ConstraintKind kind, Type first,
|
|||||||
case ConstraintKind::DynamicTypeOf:
|
case ConstraintKind::DynamicTypeOf:
|
||||||
return simplifyDynamicTypeOfConstraint(first, second, subflags, locator);
|
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
|
case ConstraintKind::Bind: // FIXME: This should go through matchTypes() above
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
@@ -4149,6 +4155,12 @@ ConstraintSystem::addConstraintImpl(ConstraintKind kind, Type first,
|
|||||||
addConstraint(c);
|
addConstraint(c);
|
||||||
return SolutionKind::Solved;
|
return SolutionKind::Solved;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case ConstraintKind::ValueMember:
|
||||||
|
case ConstraintKind::UnresolvedValueMember:
|
||||||
|
case ConstraintKind::TypeMember:
|
||||||
|
case ConstraintKind::BindOverload:
|
||||||
|
llvm_unreachable("Use the correct addConstraint()");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user