File tree Expand file tree Collapse file tree 1 file changed +1
-11
lines changed Expand file tree Collapse file tree 1 file changed +1
-11
lines changed Original file line number Diff line number Diff line change @@ -5628,17 +5628,7 @@ static void maybeWarnAboutTrailingClosureBindingChange(
5628
5628
decl->getName (), paramName, backwardParamName);
5629
5629
5630
5630
// 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)) {
5642
5632
diag.highlight (paramList->get (paramIdx)->getLoc ());
5643
5633
diag.highlight (paramList->get (*matchingBackwardParamIdx)->getLoc ());
5644
5634
}
You can’t perform that action at this time.
0 commit comments