File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -282,6 +282,9 @@ ValueDecl *RequirementFailure::getDeclRef() const {
282282 return getAffectedDeclFromType (contextualTy);
283283 }
284284
285+ if (getLocator ()->isFirstElement <LocatorPathElt::CoercionOperand>())
286+ return getAffectedDeclFromType (getOwnerType ());
287+
285288 if (auto overload = getCalleeOverloadChoiceIfAvailable (getLocator ())) {
286289 // If there is a declaration associated with this
287290 // failure e.g. an overload choice of the call
Original file line number Diff line number Diff line change @@ -3329,9 +3329,8 @@ namespace {
33293329 // bindings for the result of the coercion.
33303330 if (repr &&
33313331 repr->getKind () == TypeReprKind::ImplicitlyUnwrappedOptional) {
3332- auto *locatorIUO = CS.getConstraintLocator (expr);
3333- return createTypeVariableAndDisjunctionForIUOCoercion (toType,
3334- locatorIUO);
3332+ return createTypeVariableAndDisjunctionForIUOCoercion (
3333+ toType, CS.getConstraintLocator (expr));
33353334 }
33363335
33373336 return toType;
You can’t perform that action at this time.
0 commit comments