Skip to content

Commit c1d178a

Browse files
committed
[ConstraintSystem] NFC: Rename isFullyBound -> isDelayed and clarify associated comment
1 parent 38d25e9 commit c1d178a

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

include/swift/Sema/ConstraintSystem.h

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4762,9 +4762,16 @@ class ConstraintSystem {
47624762
/// Determine whether the set of bindings is non-empty.
47634763
explicit operator bool() const { return !Bindings.empty(); }
47644764

4765-
/// Whether these bindings should be delayed until the rest of the
4766-
/// constraint system is considered "fully bound".
4767-
bool isFullyBound() const;
4765+
/// Determine whether attempting this type variable should be
4766+
/// delayed until the rest of the constraint system is considered
4767+
/// "fully bound" meaning constraints, which affect completeness
4768+
/// of the binding set, for this type variable such as - member
4769+
/// constraint, disjunction, function application etc. - are simplified.
4770+
///
4771+
/// Note that in some situations i.e. when there are no more
4772+
/// disjunctions or type variables left to attempt, it's still
4773+
/// okay to attempt "delayed" type variable to make forward progress.
4774+
bool isDelayed() const;
47684775

47694776
/// Whether the bindings represent (potentially) incomplete set,
47704777
/// there is no way to say with absolute certainty if that's the
@@ -4808,7 +4815,7 @@ class ConstraintSystem {
48084815

48094816
return std::make_tuple(b.isHole(),
48104817
!hasNoDefaultableBindings,
4811-
b.isFullyBound(),
4818+
b.isDelayed(),
48124819
b.isSubtypeOfExistentialType(),
48134820
b.InvolvesTypeVariables,
48144821
static_cast<unsigned char>(b.LiteralBinding),
@@ -4955,8 +4962,8 @@ class ConstraintSystem {
49554962
out.indent(indent);
49564963
if (isPotentiallyIncomplete())
49574964
out << "potentially_incomplete ";
4958-
if (isFullyBound())
4959-
out << "fully_bound ";
4965+
if (isDelayed())
4966+
out << "delayed ";
49604967
if (isSubtypeOfExistentialType())
49614968
out << "subtype_of_existential ";
49624969
if (LiteralBinding != LiteralBindingKind::None)

lib/Sema/CSBindings.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ bool ConstraintSystem::PotentialBinding::isViableForJoin() const {
3333
!isDefaultableBinding();
3434
}
3535

36-
bool ConstraintSystem::PotentialBindings::isFullyBound() const {
36+
bool ConstraintSystem::PotentialBindings::isDelayed() const {
3737
if (!DelayedBy.empty())
3838
return true;
3939

@@ -788,7 +788,7 @@ bool ConstraintSystem::PotentialBindings::isViable(
788788

789789
bool ConstraintSystem::PotentialBindings::favoredOverDisjunction(
790790
Constraint *disjunction) const {
791-
if (isHole() || isFullyBound())
791+
if (isHole() || isDelayed())
792792
return false;
793793

794794
// If this bindings are for a closure and there are no holes,

0 commit comments

Comments
 (0)