Skip to content

Commit 9c5d465

Browse files
committed
[CSSimplify] Remove eager bindings for key path type to a contextual function type
This is no longer necessary for diagnostics or anything else because inference decides the type now.
1 parent 153bd9d commit 9c5d465

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6893,17 +6893,6 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
68936893
case ConstraintKind::ArgumentConversion:
68946894
case ConstraintKind::OperatorArgumentConversion: {
68956895
if (typeVar1) {
6896-
if (auto *locator = typeVar1->getImpl().getLocator()) {
6897-
// TODO(diagnostics): Only binding here for function types, because
6898-
// doing so for KeyPath types leaves the constraint system in an
6899-
// unexpected state for key path diagnostics should we fail.
6900-
if (locator->isLastElement<LocatorPathElt::KeyPathType>() &&
6901-
type2->is<AnyFunctionType>())
6902-
return matchTypesBindTypeVar(typeVar1, type2, kind,
6903-
flags | TMF_BindingTypeVariable,
6904-
locator, formUnsolvedResult);
6905-
}
6906-
69076896
// Performance optimization: Propagate fully or partially resolved
69086897
// contextual type down into the body of result builder transformed
69096898
// closure by eagerly binding intermediate body result type to the

0 commit comments

Comments
 (0)