File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -8221,13 +8221,14 @@ bool UnableToInferGenericPackElementType::diagnoseAsError() {
8221
8221
if (auto *calleeLocator = getSolution ().getCalleeLocator (locator)) {
8222
8222
if (const auto choice = getOverloadChoiceIfAvailable (calleeLocator)) {
8223
8223
if (auto *decl = choice->choice .getDeclOrNull ()) {
8224
- const auto applyArgToParamElt =
8225
- (path.end () - 2 )->getAs <LocatorPathElt::ApplyArgToParam>();
8226
- if (auto paramDecl =
8227
- getParameterAt (decl, applyArgToParamElt->getParamIdx ())) {
8228
- emitDiagnosticAt (
8229
- paramDecl->getLoc (), diag::note_in_opening_pack_element,
8230
- packElementElt->getIndex (), paramDecl->getNameStr ());
8224
+ if (auto applyArgToParamElt =
8225
+ locator->findFirst <LocatorPathElt::ApplyArgToParam>()) {
8226
+ if (auto paramDecl =
8227
+ getParameterAt (decl, applyArgToParamElt->getParamIdx ())) {
8228
+ emitDiagnosticAt (
8229
+ paramDecl->getLoc (), diag::note_in_opening_pack_element,
8230
+ packElementElt->getIndex (), paramDecl->getNameStr ());
8231
+ }
8231
8232
}
8232
8233
}
8233
8234
}
You can’t perform that action at this time.
0 commit comments