Skip to content

Commit 6debe3d

Browse files
committed
[ConstraintSystem] Don't produce conformance fixes for mismatches associated with function result type
If there are any requirement failures associated with result types which are part of a function type conversion, let's record general conversion mismatch in order for it to capture and display complete function types.
1 parent 2d10a8a commit 6debe3d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2160,6 +2160,17 @@ ConstraintSystem::matchExistentialTypes(Type type1, Type type2,
21602160

21612161
break;
21622162
}
2163+
2164+
// TODO(diagnostics): If there are any requirement failures associated
2165+
// with result types which are part of a function type conversion,
2166+
// let's record general conversion mismatch in order for it to capture
2167+
// and display complete function types.
2168+
//
2169+
// Once either reacher locators or better diagnostic presentation for
2170+
// nested type failures is available this check could be removed.
2171+
if (last->is<LocatorPathElt::FunctionResult>())
2172+
return getTypeMatchFailure(locator);
2173+
21632174
} else { // There are no elements in the path
21642175
auto *anchor = locator.getAnchor();
21652176
if (!(anchor &&

0 commit comments

Comments
 (0)