@@ -2629,39 +2629,7 @@ class ConstraintSystem {
2629
2629
// / \brief Add a potential binding to the list of bindings,
2630
2630
// / coalescing supertype bounds when we are able to compute the meet.
2631
2631
void addPotentialBinding (PotentialBinding binding,
2632
- bool allowJoinMeet = true ) {
2633
- assert (!binding.BindingType ->is <ErrorType>());
2634
-
2635
- // If this is a non-defaulted supertype binding,
2636
- // check whether we can combine it with another
2637
- // supertype binding by computing the 'join' of the types.
2638
- if (binding.Kind == AllowedBindingKind::Supertypes &&
2639
- !binding.BindingType ->hasTypeVariable () &&
2640
- !binding.DefaultedProtocol && !binding.isDefaultableBinding () &&
2641
- allowJoinMeet) {
2642
- if (lastSupertypeIndex) {
2643
- // Can we compute a join?
2644
- auto &lastBinding = Bindings[*lastSupertypeIndex];
2645
- auto lastType = lastBinding.BindingType ->getWithoutSpecifierType ();
2646
- auto bindingType = binding.BindingType ->getWithoutSpecifierType ();
2647
- auto join = Type::join (lastType, bindingType);
2648
- if (join) {
2649
- auto anyType = join->getASTContext ().TheAnyType ;
2650
- if (!join->isEqual (anyType) || lastType->isEqual (anyType) ||
2651
- bindingType->isEqual (anyType)) {
2652
- // Replace the last supertype binding with the join. We're done.
2653
- lastBinding.BindingType = join;
2654
- return ;
2655
- }
2656
- }
2657
- }
2658
-
2659
- // Record this as the most recent supertype index.
2660
- lastSupertypeIndex = Bindings.size ();
2661
- }
2662
-
2663
- Bindings.push_back (std::move (binding));
2664
- }
2632
+ bool allowJoinMeet = true );
2665
2633
2666
2634
void dump (llvm::raw_ostream &out,
2667
2635
unsigned indent = 0 ) const LLVM_ATTRIBUTE_USED {
0 commit comments