@@ -565,20 +565,6 @@ ConformanceLookupTable::Ordering ConformanceLookupTable::compareConformances(
565565 ConformanceEntry *lhs,
566566 ConformanceEntry *rhs,
567567 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-
582568 ConformanceEntryKind lhsKind = lhs->getRankingKind ();
583569 ConformanceEntryKind rhsKind = rhs->getRankingKind ();
584570
@@ -596,6 +582,20 @@ ConformanceLookupTable::Ordering ConformanceLookupTable::compareConformances(
596582 }
597583 }
598584
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+
599599 // If one entry is fixed and the other is not, we have our answer.
600600 if (lhs->isFixed () != rhs->isFixed ()) {
601601 auto isReplaceableOrMarker = [](ConformanceEntry *entry) -> bool {
0 commit comments