Skip to content

Commit 91acf1d

Browse files
committed
Assert if SubstitutionMap::subst tries to replace a non-pack with a pack
1 parent 72cc8dc commit 91acf1d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/AST/SubstitutionMap.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,8 @@ SubstitutionMap SubstitutionMap::subst(TypeSubstitutionFn subs,
458458
continue;
459459
}
460460
newSubs.push_back(type.subst(subs, conformances, options));
461+
assert(type->is<PackType>() == newSubs.back()->is<PackType>() &&
462+
"substitution changed the pack-ness of a replacement type");
461463
}
462464

463465
SmallVector<ProtocolConformanceRef, 4> newConformances;

0 commit comments

Comments
 (0)