Skip to content

Commit 9d19ef2

Browse files
committed
[Cleanup] Use swift::getParameterList() rather than hard-coding it.
1 parent 82e4c50 commit 9d19ef2

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
@@ -5628,17 +5628,7 @@ static void maybeWarnAboutTrailingClosureBindingChange(
56285628
decl->getName(), paramName, backwardParamName);
56295629

56305630
// Dig out the parameter declarations so we can highlight them.
5631-
// FIXME: There should be a utility for this.
5632-
const ParameterList *paramList = nullptr;
5633-
if (auto *func = dyn_cast<AbstractFunctionDecl>(decl)) {
5634-
paramList = func->getParameters();
5635-
} else if (auto *subscript = dyn_cast<SubscriptDecl>(decl)) {
5636-
paramList = subscript->getIndices();
5637-
} else if (auto *enumElement = dyn_cast<EnumElementDecl>(decl)) {
5638-
paramList = enumElement->getParameterList();
5639-
}
5640-
5641-
if (paramList) {
5631+
if (const ParameterList *paramList = getParameterList(decl)) {
56425632
diag.highlight(paramList->get(paramIdx)->getLoc());
56435633
diag.highlight(paramList->get(*matchingBackwardParamIdx)->getLoc());
56445634
}

0 commit comments

Comments
 (0)