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 {
282
282
return getAffectedDeclFromType (contextualTy);
283
283
}
284
284
285
+ if (getLocator ()->isFirstElement <LocatorPathElt::CoercionOperand>())
286
+ return getAffectedDeclFromType (getOwnerType ());
287
+
285
288
if (auto overload = getCalleeOverloadChoiceIfAvailable (getLocator ())) {
286
289
// If there is a declaration associated with this
287
290
// failure e.g. an overload choice of the call
Original file line number Diff line number Diff line change @@ -3329,9 +3329,8 @@ namespace {
3329
3329
// bindings for the result of the coercion.
3330
3330
if (repr &&
3331
3331
repr->getKind () == TypeReprKind::ImplicitlyUnwrappedOptional) {
3332
- auto *locatorIUO = CS.getConstraintLocator (expr);
3333
- return createTypeVariableAndDisjunctionForIUOCoercion (toType,
3334
- locatorIUO);
3332
+ return createTypeVariableAndDisjunctionForIUOCoercion (
3333
+ toType, CS.getConstraintLocator (expr));
3335
3334
}
3336
3335
3337
3336
return toType;
You can’t perform that action at this time.
0 commit comments