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() {
82218221 if (auto *calleeLocator = getSolution ().getCalleeLocator (locator)) {
82228222 if (const auto choice = getOverloadChoiceIfAvailable (calleeLocator)) {
82238223 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+ }
82318232 }
82328233 }
82338234 }
You can’t perform that action at this time.
0 commit comments