File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -482,6 +482,12 @@ class BindingSet {
482482 !Defaults.empty ();
483483 }
484484
485+ // / Determine whether this set can be chosen as the next binding set
486+ // / to attempt.
487+ bool isViable () const {
488+ return hasViableBindings () || isDirectHole ();
489+ }
490+
485491 ArrayRef<Constraint *> getConformanceRequirements () const {
486492 return Protocols;
487493 }
Original file line number Diff line number Diff line change @@ -1170,7 +1170,7 @@ std::optional<BindingSet> ConstraintSystem::determineBestBindings(
11701170 // associated with given type variable, any default constraints,
11711171 // or any conformance requirements to literal protocols with can
11721172 // produce a default type.
1173- bool isViable = bindings.hasViableBindings () || bindings. isDirectHole ();
1173+ bool isViable = bindings.isViable ();
11741174
11751175 bindings.inferTransitiveSupertypeBindings ();
11761176 bindings.determineLiteralCoverage ();
Original file line number Diff line number Diff line change @@ -922,7 +922,7 @@ bool ConstraintGraph::contractEdges() {
922922 if (tyvar1->getImpl ().canBindToInOut ()) {
923923 bool isNotContractable = true ;
924924 auto bindings = CS.getBindingsFor (tyvar1);
925- if (bindings.hasViableBindings () || bindings. isDirectHole ()) {
925+ if (bindings.isViable ()) {
926926 // Holes can't be contracted.
927927 if (bindings.isHole ())
928928 continue ;
You can’t perform that action at this time.
0 commit comments