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(
4270
4270
for (const auto &solution : solutions) {
4271
4271
auto overload = solution.getOverloadChoice (calleeLocator);
4272
4272
if (auto *decl = overload.choice .getDeclOrNull ()) {
4273
- auto loc = decl->getLoc ();
4274
- if (loc.isInvalid ())
4275
- continue ;
4276
-
4277
4273
auto type = solution.simplifyType (overload.boundType );
4278
4274
4279
4275
if (isExpr<ApplyExpr>(anchor) || isExpr<SubscriptExpr>(anchor)) {
4280
4276
auto fnType = type->castTo <FunctionType>();
4281
4277
DE.diagnose (
4282
- loc ,
4278
+ decl ,
4283
4279
contextualTy->is <ProtocolType>()
4284
4280
? diag::overload_result_type_does_not_conform
4285
4281
: diag::cannot_convert_candidate_result_to_contextual_type,
4286
4282
decl->getName (), fnType->getResult (), contextualTy);
4287
4283
} else {
4288
- DE.diagnose (loc , diag::found_candidate_type, type);
4284
+ DE.diagnose (decl , diag::found_candidate_type, type);
4289
4285
}
4290
4286
}
4291
4287
}
You can’t perform that action at this time.
0 commit comments