@@ -565,20 +565,6 @@ ConformanceLookupTable::Ordering ConformanceLookupTable::compareConformances(
565
565
ConformanceEntry *lhs,
566
566
ConformanceEntry *rhs,
567
567
bool &diagnoseSuperseded) {
568
- // If only one of the conformances is unconditionally available on the
569
- // current deployment target, pick that one.
570
- //
571
- // FIXME: Conformance lookup should really depend on source location for
572
- // this to be 100% correct.
573
- // FIXME: When a class and an extension with the same availability declare the
574
- // same conformance, this silently takes the class and drops the extension.
575
- if (lhs->getDeclContext ()->isAlwaysAvailableConformanceContext () !=
576
- rhs->getDeclContext ()->isAlwaysAvailableConformanceContext ()) {
577
- return (lhs->getDeclContext ()->isAlwaysAvailableConformanceContext ()
578
- ? Ordering::Before
579
- : Ordering::After);
580
- }
581
-
582
568
ConformanceEntryKind lhsKind = lhs->getRankingKind ();
583
569
ConformanceEntryKind rhsKind = rhs->getRankingKind ();
584
570
@@ -596,6 +582,20 @@ ConformanceLookupTable::Ordering ConformanceLookupTable::compareConformances(
596
582
}
597
583
}
598
584
585
+ // If only one of the conformances is unconditionally available on the
586
+ // current deployment target, pick that one.
587
+ //
588
+ // FIXME: Conformance lookup should really depend on source location for
589
+ // this to be 100% correct.
590
+ // FIXME: When a class and an extension with the same availability declare the
591
+ // same conformance, this silently takes the class and drops the extension.
592
+ if (lhs->getDeclContext ()->isAlwaysAvailableConformanceContext () !=
593
+ rhs->getDeclContext ()->isAlwaysAvailableConformanceContext ()) {
594
+ return (lhs->getDeclContext ()->isAlwaysAvailableConformanceContext ()
595
+ ? Ordering::Before
596
+ : Ordering::After);
597
+ }
598
+
599
599
// If one entry is fixed and the other is not, we have our answer.
600
600
if (lhs->isFixed () != rhs->isFixed ()) {
601
601
auto isReplaceableOrMarker = [](ConformanceEntry *entry) -> bool {
0 commit comments