Skip to content

Commit 7c91107

Browse files
committed
[AST] PackMatcher/NFC: Expand a comment to explain why per-index match is okay in some cases
1 parent fe6cfe2 commit 7c91107

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

include/swift/AST/PackExpansionMatcher.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,13 @@ class TypeListPackMatcher {
186186
}
187187
}
188188

189-
// Both sides have equal number of pack expansion type.
189+
// If both sides have the same number of elements and all of
190+
// them are pack expansions there is not going to be any
191+
// expansion "absorption" and it's okay to match per-index.
192+
//
193+
// Like in all previous cases the callers are responsible
194+
// to check whether the element types actually line up,
195+
// this is a purely structural match.
190196
if (lhsElts.size() == rhsElts.size()) {
191197
for (unsigned i = 0, n = lhsElts.size(); i != n; ++i) {
192198
auto lhsType = getElementType(lhsElts[i]);

0 commit comments

Comments
 (0)