Skip to content

Commit f224202

Browse files
committed
[ConstraintSystem] NFC: Require all binding producers to implement needsToComputeNext
Instead of defaulting to `false`, let's make implementers of `BindingProducer` consider what needs to happen.
1 parent 0441183 commit f224202

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/swift/Sema/ConstraintSystem.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5433,7 +5433,7 @@ class BindingProducer {
54335433
/// This is useful to be able to exhaustively attempt bindings
54345434
/// for type variables found at one level, before proceeding to
54355435
/// supertypes or literal defaults etc.
5436-
virtual bool needsToComputeNext() const { return false; }
5436+
virtual bool needsToComputeNext() const = 0;
54375437
};
54385438

54395439
class TypeVarBindingProducer : public BindingProducer<TypeVariableBinding> {
@@ -5592,6 +5592,8 @@ class DisjunctionChoiceProducer : public BindingProducer<DisjunctionChoice> {
55925592
IsExplicitConversion, isBeginningOfPartition);
55935593
}
55945594

5595+
bool needsToComputeNext() const override { return false; }
5596+
55955597
private:
55965598
// Partition the choices in the disjunction into groups that we will
55975599
// iterate over in an order appropriate to attempt to stop before we

0 commit comments

Comments
 (0)