@@ -614,25 +614,6 @@ bool DisjunctionStep::shortCircuitDisjunctionAt(
614
614
Constraint *currentChoice, Constraint *lastSuccessfulChoice) const {
615
615
auto &ctx = CS.getASTContext ();
616
616
617
- // If the successfully applied constraint is favored, we'll consider that to
618
- // be the "best". If it was only temporarily favored because it matched other
619
- // operator bindings, we can even short-circuit other favored constraints.
620
- if (lastSuccessfulChoice->isFavored () &&
621
- (!currentChoice->isFavored () ||
622
- (CS.solverState ->isTemporarilyFavored (lastSuccessfulChoice) &&
623
- !CS.solverState ->isTemporarilyFavored (currentChoice)))) {
624
- #if !defined(NDEBUG)
625
- if (lastSuccessfulChoice->getKind () == ConstraintKind::BindOverload) {
626
- auto overloadChoice = lastSuccessfulChoice->getOverloadChoice ();
627
- assert ((!overloadChoice.isDecl () ||
628
- !overloadChoice.getDecl ()->getAttrs ().isUnavailable (ctx)) &&
629
- " Unavailable decl should not be favored!" );
630
- }
631
- #endif
632
-
633
- return true ;
634
- }
635
-
636
617
// Anything without a fix is better than anything with a fix.
637
618
if (currentChoice->getFix () && !lastSuccessfulChoice->getFix ())
638
619
return true ;
@@ -670,36 +651,6 @@ bool DisjunctionStep::shortCircuitDisjunctionAt(
670
651
if (isSIMDOperator (currentChoice->getOverloadChoice ().getDecl ()) &&
671
652
!isSIMDOperator (lastSuccessfulChoice->getOverloadChoice ().getDecl ()))
672
653
return true ;
673
-
674
- // Otherwise if we have an existing solution, bind tyvars bound to the same
675
- // decl in the solution to the choice tyvar. We can continue finding more
676
- // solutions, but all the instances of the operator that chose the same
677
- // overload as this successful choice will be bound togeter.
678
- if (Solutions.size ()) {
679
- auto lastTyvar =
680
- lastSuccessfulChoice->getFirstType ()->getAs <TypeVariableType>();
681
- auto lastRep = CS.getRepresentative (lastTyvar);
682
-
683
- for (auto overload : Solutions[0 ].overloadChoices ) {
684
- auto overloadChoice = overload.getSecond ().choice ;
685
- if (!overloadChoice.isDecl () ||
686
- overloadChoice.getDecl () !=
687
- lastSuccessfulChoice->getOverloadChoice ().getDecl ())
688
- continue ;
689
-
690
- auto choiceTyvar =
691
- CS.getType (simplifyLocatorToAnchor (overload.getFirst ()))
692
- ->getAs <TypeVariableType>();
693
- if (!choiceTyvar)
694
- continue ;
695
-
696
- auto rep = CS.getRepresentative (choiceTyvar);
697
- if (lastRep != rep) {
698
- CS.mergeEquivalenceClasses (rep, lastRep, /* updateWorkList=*/ false );
699
- lastRep = CS.getRepresentative (lastRep);
700
- }
701
- }
702
- }
703
654
}
704
655
return false ;
705
656
}
0 commit comments