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