Skip to content

Commit 6d29e75

Browse files
[CSBindings] Improving comment explaning marking projected value as fully bounded
1 parent 5cf230c commit 6d29e75

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/Sema/CSBindings.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,11 @@ ConstraintSystem::getPotentialBindings(TypeVariableType *typeVar) const {
551551
if (result.FullyBound)
552552
continue;
553553

554-
// If this variable is in the application projected result type, it is
555-
// fully bound.
554+
// If this variable is in the application projected result type, mark the
555+
// result as `FullyBound` to ensure we delay binding until we've bound
556+
// other type variables in the KeyPathApplication constraint. This ensures
557+
// we try to bind the key path type first, which can allow us to discover
558+
// additional bindings for the result type.
556559
SmallPtrSet<TypeVariableType *, 4> typeVars;
557560
findInferableTypeVars(simplifyType(constraint->getThirdType()), typeVars);
558561
if (typeVars.count(typeVar))

0 commit comments

Comments
 (0)