Skip to content

Commit 6769e39

Browse files
committed
[ConstraintSystem] Add a new locator element to identify pack expansion types
1 parent dd813af commit 6769e39

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

include/swift/Sema/ConstraintLocatorPathElts.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ CUSTOM_LOCATOR_PATH_ELT(PackElement)
202202
/// The shape of a parameter pack.
203203
SIMPLE_LOCATOR_PATH_ELT(PackShape)
204204

205+
/// The type of pack expansion
206+
SIMPLE_LOCATOR_PATH_ELT(PackExpansionType)
207+
205208
/// The pattern of a pack expansion.
206209
SIMPLE_LOCATOR_PATH_ELT(PackExpansionPattern)
207210

lib/Sema/ConstraintLocator.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ unsigned LocatorPathElt::getNewSummaryFlags() const {
106106
case ConstraintLocator::AnyPatternDecl:
107107
case ConstraintLocator::GlobalActorType:
108108
case ConstraintLocator::CoercionOperand:
109+
case ConstraintLocator::PackExpansionType:
109110
return 0;
110111

111112
case ConstraintLocator::FunctionArgument:
@@ -501,6 +502,10 @@ void LocatorPathElt::dump(raw_ostream &out) const {
501502
case ConstraintLocator::CoercionOperand: {
502503
out << "coercion operand";
503504
break;
505+
506+
case ConstraintLocator::PackExpansionType:
507+
out << "pack expansion type";
508+
break;
504509
}
505510
}
506511
}

lib/Sema/ConstraintSystem.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5751,6 +5751,7 @@ void constraints::simplifyLocator(ASTNode &anchor,
57515751

57525752
case ConstraintLocator::PackElement:
57535753
case ConstraintLocator::PackShape:
5754+
case ConstraintLocator::PackExpansionType:
57545755
break;
57555756

57565757
case ConstraintLocator::PackExpansionPattern: {

0 commit comments

Comments
 (0)