mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
AST: Promote AssociatedTypeAvailability feature to the baseline.
This commit is contained in:
@@ -169,7 +169,7 @@ BASELINE_LANGUAGE_FEATURE(UnsafeInheritExecutor, 0, "@_unsafeInheritExecutor")
|
||||
SUPPRESSIBLE_LANGUAGE_FEATURE(PrimaryAssociatedTypes2, 346, "Primary associated types")
|
||||
BASELINE_LANGUAGE_FEATURE(UnavailableFromAsync, 0, "@_unavailableFromAsync")
|
||||
BASELINE_LANGUAGE_FEATURE(NoAsyncAvailability, 340, "@available(*, noasync)")
|
||||
SUPPRESSIBLE_LANGUAGE_FEATURE(AssociatedTypeAvailability, 0, "Availability on associated types")
|
||||
BASELINE_LANGUAGE_FEATURE(AssociatedTypeAvailability, 0, "Availability on associated types")
|
||||
SUPPRESSIBLE_LANGUAGE_FEATURE(AsyncSequenceFailure, 0, "Failure associated type on AsyncSequence and AsyncIteratorProtocol")
|
||||
BASELINE_LANGUAGE_FEATURE(BuiltinIntLiteralAccessors, 368, "Builtin.IntLiteral accessors")
|
||||
LANGUAGE_FEATURE(Macros, 0, "Macros")
|
||||
|
||||
@@ -3067,15 +3067,6 @@ static void suppressingFeaturePrimaryAssociatedTypes2(PrintOptions &options,
|
||||
options.PrintPrimaryAssociatedTypes = originalPrintPrimaryAssociatedTypes;
|
||||
}
|
||||
|
||||
static void
|
||||
suppressingFeatureAssociatedTypeAvailability(
|
||||
PrintOptions &options, llvm::function_ref<void()> action) {
|
||||
unsigned originalExcludeAttrCount = options.ExcludeAttrList.size();
|
||||
options.ExcludeAttrList.push_back(DeclAttrKind::Available);
|
||||
action();
|
||||
options.ExcludeAttrList.resize(originalExcludeAttrCount);
|
||||
}
|
||||
|
||||
static void
|
||||
suppressingFeatureAsyncSequenceFailure(
|
||||
PrintOptions &options, llvm::function_ref<void()> action) {
|
||||
|
||||
@@ -150,11 +150,6 @@ static bool usesFeaturePrimaryAssociatedTypes2(Decl *decl) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool usesFeatureAssociatedTypeAvailability(Decl *decl) {
|
||||
return isa<AssociatedTypeDecl>(decl) &&
|
||||
decl->getAttrs().hasAttribute<AvailableAttr>();
|
||||
}
|
||||
|
||||
static bool isImplicitRethrowsProtocol(const ProtocolDecl *proto) {
|
||||
return proto->isSpecificProtocol(KnownProtocolKind::AsyncSequence) ||
|
||||
proto->isSpecificProtocol(KnownProtocolKind::AsyncIteratorProtocol);
|
||||
|
||||
@@ -6,12 +6,8 @@
|
||||
|
||||
// CHECK: public protocol P
|
||||
public protocol P {
|
||||
// CHECK: #if compiler(>=5.3) && $AssociatedTypeAvailability
|
||||
// CHECK-NEXT: @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
// CHECK: @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
// CHECK-NEXT: associatedtype AT = Self
|
||||
// CHECK-NEXT: #else
|
||||
// CHECK-NEXT: associatedtype AT = Self
|
||||
// CHECK-NEXT: #endif
|
||||
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
|
||||
associatedtype AT = Self
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user