Skip to content

Commit a6d2a34

Browse files
committed
Recognize parameter ownership inside pack expansions
1 parent 9d9e015 commit a6d2a34

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/Sema/TypeCheckDecl.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2198,6 +2198,11 @@ ParamSpecifierRequest::evaluate(Evaluator &evaluator,
21982198
assert(typeRepr != nullptr && "Should call setSpecifier() on "
21992199
"synthesized parameter declarations");
22002200

2201+
// Look through top-level pack expansions. These specifiers are
2202+
// part of what's repeated.
2203+
if (auto expansion = dyn_cast<PackExpansionTypeRepr>(typeRepr))
2204+
typeRepr = expansion->getPatternType();
2205+
22012206
// Look through parens here; other than parens, specifiers
22022207
// must appear at the top level of a parameter type.
22032208
auto *nestedRepr = typeRepr->getWithoutParens();

0 commit comments

Comments
 (0)