mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
ModuleInterface: Stop printing $CustomAvailability guards in swiftinterfaces.
All supported compilers can now parse `@available` attributes that reference custom availability domains.
This commit is contained in:
@@ -354,14 +354,7 @@ static bool usesFeatureCoroutineAccessors(Decl *decl) {
|
||||
}
|
||||
|
||||
UNINTERESTING_FEATURE(GeneralizedIsSameMetaTypeBuiltin)
|
||||
|
||||
static bool usesFeatureCustomAvailability(Decl *decl) {
|
||||
for (auto attr : decl->getSemanticAvailableAttrs()) {
|
||||
if (attr.getDomain().isCustom())
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
UNINTERESTING_FEATURE(CustomAvailability)
|
||||
|
||||
static bool usesFeatureAsyncExecutionBehaviorAttributes(Decl *decl) {
|
||||
// Explicit `@concurrent` attribute on the declaration.
|
||||
|
||||
@@ -15,18 +15,16 @@
|
||||
|
||||
import Oceans // re-exports Rivers
|
||||
|
||||
// CHECK: #if compiler(>=5.3) && $CustomAvailability
|
||||
// CHECK-NEXT: @available(Colorado)
|
||||
// CHECK-NOT: $CustomAvailability
|
||||
|
||||
// CHECK: @available(Colorado)
|
||||
// CHECK-NEXT: public func availableInColorado()
|
||||
// CHECK-NEXT: #endif
|
||||
@available(Colorado)
|
||||
public func availableInColorado() { }
|
||||
|
||||
// CHECK: #if compiler(>=5.3) && $CustomAvailability
|
||||
// CHECK-NEXT: @available(Arctic, unavailable)
|
||||
// CHECK: @available(Arctic, unavailable)
|
||||
// CHECK-NEXT: @available(Pacific)
|
||||
// CHECK-NEXT: public func unavailableInArcticButAvailableInPacific()
|
||||
// CHECK-NEXT: #endif
|
||||
@available(Arctic, unavailable)
|
||||
@available(Pacific)
|
||||
public func unavailableInArcticButAvailableInPacific() { }
|
||||
|
||||
Reference in New Issue
Block a user