mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ConstraintSystem] Use fallback type constraint to default pack expansion
Binding of pack expansion types is delayed until solving but use of `Defaultable` was preventing it from being considered early because that constraint impacts binding set ranking, switching to `FallbackType` constraint give us better semantics where pack expansion type variables are going to be bound as soon as they have a contextual type. Resolves: rdar://110819621
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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user