mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #66708 from xedin/generalize-default-closure-type-constraint
[ConstraintSystem] Use fallback type constraint to default pack expansion
This commit is contained in:
@@ -1031,7 +1031,7 @@ Type ConstraintSystem::openPackExpansionType(PackExpansionType *expansion,
|
||||
// This constraint is important to make sure that pack expansion always
|
||||
// has a binding and connect pack expansion var to any type variables
|
||||
// that appear in pattern and shape types.
|
||||
addUnsolvedConstraint(Constraint::create(*this, ConstraintKind::Defaultable,
|
||||
addUnsolvedConstraint(Constraint::create(*this, ConstraintKind::FallbackType,
|
||||
expansionVar, openedPackExpansion,
|
||||
expansionLoc));
|
||||
|
||||
@@ -7419,7 +7419,7 @@ bool TypeVarBindingProducer::requiresOptionalAdjustment(
|
||||
PotentialBinding
|
||||
TypeVarBindingProducer::getDefaultBinding(Constraint *constraint) const {
|
||||
assert(constraint->getKind() == ConstraintKind::Defaultable ||
|
||||
constraint->getKind() == ConstraintKind::DefaultClosureType);
|
||||
constraint->getKind() == ConstraintKind::FallbackType);
|
||||
|
||||
auto type = constraint->getSecondType();
|
||||
Binding binding{type, BindingKind::Exact, constraint};
|
||||
|
||||
Reference in New Issue
Block a user