File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -4270,22 +4270,18 @@ static bool diagnoseAmbiguityWithContextualType(
42704270 for (const auto &solution : solutions) {
42714271 auto overload = solution.getOverloadChoice (calleeLocator);
42724272 if (auto *decl = overload.choice .getDeclOrNull ()) {
4273- auto loc = decl->getLoc ();
4274- if (loc.isInvalid ())
4275- continue ;
4276-
42774273 auto type = solution.simplifyType (overload.boundType );
42784274
42794275 if (isExpr<ApplyExpr>(anchor) || isExpr<SubscriptExpr>(anchor)) {
42804276 auto fnType = type->castTo <FunctionType>();
42814277 DE.diagnose (
4282- loc ,
4278+ decl ,
42834279 contextualTy->is <ProtocolType>()
42844280 ? diag::overload_result_type_does_not_conform
42854281 : diag::cannot_convert_candidate_result_to_contextual_type,
42864282 decl->getName (), fnType->getResult (), contextualTy);
42874283 } else {
4288- DE.diagnose (loc , diag::found_candidate_type, type);
4284+ DE.diagnose (decl , diag::found_candidate_type, type);
42894285 }
42904286 }
42914287 }
You can’t perform that action at this time.
0 commit comments