Skip to content

Commit 2eb96d0

Browse files
committed
[TypeResolution] Remove unnecessary parameter pack special case from function
type resolution. This code is a remnant from when parameter packs and classic variadic parameters both used the '...' syntax. Now, parameter packs can use the standard 'resolveType' code path.
1 parent 8d0b187 commit 2eb96d0

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

lib/Sema/TypeCheckType.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3158,20 +3158,7 @@ TypeResolver::resolveASTFunctionTypeParams(TupleTypeRepr *inputRepr,
31583158
// Do we have an old-style variadic parameter?
31593159
bool variadic = false;
31603160

3161-
if (auto *packExpansionTypeRepr = dyn_cast<PackExpansionTypeRepr>(nestedRepr)) {
3162-
auto patternOptions = elementOptions;
3163-
patternOptions.setContext(TypeResolverContext::VariadicFunctionInput);
3164-
3165-
auto pair = maybeResolvePackExpansionType(packExpansionTypeRepr,
3166-
patternOptions);
3167-
if (pair.first->hasError()) {
3168-
elements.emplace_back(ErrorType::get(getASTContext()));
3169-
continue;
3170-
}
3171-
3172-
// We have a pack expansion type.
3173-
ty = PackExpansionType::get(pair.first, pair.second);
3174-
} else if (auto *varargTypeRepr = dyn_cast<VarargTypeRepr>(nestedRepr)) {
3161+
if (auto *varargTypeRepr = dyn_cast<VarargTypeRepr>(nestedRepr)) {
31753162
if (ellipsisLoc) {
31763163
diagnose(varargTypeRepr->getLoc(),
31773164
diag::multiple_ellipsis_in_tuple)

0 commit comments

Comments
 (0)