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 @@ -5562,17 +5562,7 @@ static void maybeWarnAboutTrailingClosureBindingChange(
5562
5562
decl->getName (), paramName, backwardParamName);
5563
5563
5564
5564
// 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)) {
5576
5566
diag.highlight (paramList->get (paramIdx)->getLoc ());
5577
5567
diag.highlight (paramList->get (*matchingBackwardParamIdx)->getLoc ());
5578
5568
}
You can’t perform that action at this time.
0 commit comments