mirror of
https://github.com/apple/swift.git
synced 2026-06-27 12:25:55 +02:00
ModuleInterface: Handle more synthesized conformance availability corner cases.
As a follow up to https://github.com/swiftlang/swift/pull/87832, continue adjusting the algorithm for computing synthesized conformance availability. When an outer declaration is `unavailable` in a more specific platform domain and the inner declaration is `introduced:` in a less specific domain, the inner declaration attribute does not override the outer declaration attribute. Unavailability and introduction on separate axes of availability. Resolves rdar://173724423.
This commit is contained in:
@@ -458,11 +458,14 @@ 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.
|
||||
bool alreadyHasMoreSpecificAttrForThisPlatform = llvm::any_of(
|
||||
bool alreadyHasActiveAttrForDomain = llvm::any_of(
|
||||
*cache, [nextAttr](SemanticAvailableAttr existingAttr) {
|
||||
if (nextAttr.getParsedAttr()->getKind() !=
|
||||
existingAttr.getParsedAttr()->getKind())
|
||||
return false;
|
||||
return existingAttr.getDomain().contains(nextAttr.getDomain());
|
||||
});
|
||||
if (alreadyHasMoreSpecificAttrForThisPlatform)
|
||||
if (alreadyHasActiveAttrForDomain)
|
||||
continue;
|
||||
pendingAttrs.push_back(nextAttr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user