Skip to content

Commit fa83750

Browse files
committed
[Cleanup] Use swift::getParameterList() rather than hard-coding it.
1 parent 4acb094 commit fa83750

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

lib/Sema/CSApply.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5562,17 +5562,7 @@ static void maybeWarnAboutTrailingClosureBindingChange(
55625562
decl->getName(), paramName, backwardParamName);
55635563

55645564
// Dig out the parameter declarations so we can highlight them.
5565-
// FIXME: There should be a utility for this.
5566-
const ParameterList *paramList = nullptr;
5567-
if (auto *func = dyn_cast<AbstractFunctionDecl>(decl)) {
5568-
paramList = func->getParameters();
5569-
} else if (auto *subscript = dyn_cast<SubscriptDecl>(decl)) {
5570-
paramList = subscript->getIndices();
5571-
} else if (auto *enumElement = dyn_cast<EnumElementDecl>(decl)) {
5572-
paramList = enumElement->getParameterList();
5573-
}
5574-
5575-
if (paramList) {
5565+
if (const ParameterList *paramList = getParameterList(decl)) {
55765566
diag.highlight(paramList->get(paramIdx)->getLoc());
55775567
diag.highlight(paramList->get(*matchingBackwardParamIdx)->getLoc());
55785568
}

0 commit comments

Comments
 (0)