ModuleInterface: Handle custom availability domains for synthesized conformances.

When gathering availability attributes to print in a .swiftinterface for
synthesized conformances to inherited protocols, don't assume availabilty
attributes always have a platform kind.

Resolves rdar://170361240.
This commit is contained in:
Allan Shortlidge
2026-02-28 17:56:31 -08:00
parent a25e5b7264
commit bee3eb843b
2 changed files with 32 additions and 3 deletions
+2 -3
View File
@@ -456,10 +456,9 @@ class InheritedProtocolCollector {
for (auto nextAttr : D->getSemanticAvailableAttrs()) {
// FIXME: This is just approximating the effects of nested availability
// attributes for the same platform; formally they'd need to be merged.
// FIXME: [availability] This should compare availability domains.
bool alreadyHasMoreSpecificAttrForThisPlatform = llvm::any_of(
*cache, [nextAttr](SemanticAvailableAttr existingAttr) {
return existingAttr.getPlatform() == nextAttr.getPlatform();
return existingAttr.getDomain() == nextAttr.getDomain();
});
if (alreadyHasMoreSpecificAttrForThisPlatform)
continue;
@@ -695,7 +694,7 @@ public:
if (!printOptions.shouldPrint(nominal))
return;
/// is this nominal specifically an 'actor' or 'distributed actor'?
// Is this nominal specifically an 'actor' or 'distributed actor'?
bool anyActorClass = false;
if (auto klass = dyn_cast<ClassDecl>(nominal)) {
anyActorClass = klass->isAnyActor();