@@ -2394,7 +2394,7 @@ class ConstraintSystem {
23942394 llvm::SmallDenseMap<ConstraintLocator *, OpenedArchetypeType *, 4 >
23952395 OpenedExistentialTypes;
23962396
2397- llvm::SmallMapVector <PackExpansionType *, TypeVariableType *, 4 >
2397+ llvm::SmallDenseMap <PackExpansionType *, TypeVariableType *, 4 >
23982398 OpenedPackExpansionTypes;
23992399
24002400 llvm::SmallMapVector<ConstraintLocator *, std::pair<UUID, Type>, 4 >
@@ -2883,9 +2883,6 @@ class ConstraintSystem {
28832883 // / FIXME: Remove this.
28842884 unsigned numFixes;
28852885
2886- // / The length of \c OpenedPackExpansionsTypes.
2887- unsigned numOpenedPackExpansionTypes;
2888-
28892886 // / The length of \c PackExpansionEnvironments.
28902887 unsigned numPackExpansionEnvironments;
28912888
@@ -4335,6 +4332,16 @@ class ConstraintSystem {
43354332 OpenedTypeMap &replacements,
43364333 ConstraintLocatorBuilder locator);
43374334
4335+ // / Update OpenedPackExpansionTypes and record a change in the trail.
4336+ void recordOpenedPackExpansionType (PackExpansionType *expansion,
4337+ TypeVariableType *expansionVar);
4338+
4339+ // / Undo the above change.
4340+ void removeOpenedPackExpansionType (PackExpansionType *expansion) {
4341+ bool erased = OpenedPackExpansionTypes.erase (expansion);
4342+ ASSERT (erased);
4343+ }
4344+
43384345public:
43394346 // / Recurse over the given type and open any opaque archetype types.
43404347 Type openOpaqueType (Type type, ContextualTypePurpose context,
0 commit comments