@@ -1906,6 +1906,16 @@ void AttributeChecker::visitAvailableAttr(AvailableAttr *attr) {
1906
1906
!attr->isPackageDescriptionVersionSpecific ())
1907
1907
return ;
1908
1908
1909
+ // Make sure there isn't a more specific attribute we should be using instead.
1910
+ // findMostSpecificActivePlatform() is O(N), so only do this if we're checking
1911
+ // an iOS attribute while building for macCatalyst.
1912
+ if (attr->Platform == PlatformKind::iOS &&
1913
+ isPlatformActive (PlatformKind::macCatalyst, Ctx.LangOpts )) {
1914
+ if (attr != D->getAttrs ().findMostSpecificActivePlatform (Ctx)) {
1915
+ return ;
1916
+ }
1917
+ }
1918
+
1909
1919
SourceLoc attrLoc = attr->getLocation ();
1910
1920
auto versionAvailability = attr->getVersionAvailability (Ctx);
1911
1921
if (versionAvailability == AvailableVersionComparison::Obsoleted ||
@@ -1932,16 +1942,6 @@ void AttributeChecker::visitAvailableAttr(AvailableAttr *attr) {
1932
1942
if (!attr->hasPlatform () || !attr->Introduced .has_value ())
1933
1943
return ;
1934
1944
1935
- // Make sure there isn't a more specific attribute we should be using instead.
1936
- // findMostSpecificActivePlatform() is O(N), so only do this if we're checking
1937
- // an iOS attribute while building for macCatalyst.
1938
- if (attr->Platform == PlatformKind::iOS &&
1939
- isPlatformActive (PlatformKind::macCatalyst, Ctx.LangOpts )) {
1940
- if (attr != D->getAttrs ().findMostSpecificActivePlatform (Ctx)) {
1941
- return ;
1942
- }
1943
- }
1944
-
1945
1945
// Find the innermost enclosing declaration with an availability
1946
1946
// range annotation and ensure that this attribute's available version range
1947
1947
// is fully contained within that declaration's range. If there is no such
0 commit comments