Skip to content

Commit 9a7df88

Browse files
committed
ASTPrinter: Rename PrimaryAssociatedTypes feature to PrimaryAssociatedTypes2
There was a window where the PrimaryAssociatedTypes feature guarded the old syntax; let's make sure we don't see breakage if a new standard library is used with an old compiler.
1 parent 773b755 commit 9a7df88

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

include/swift/Basic/Features.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ LANGUAGE_FEATURE(BuiltinStackAlloc, 0, "Builtin.stackAlloc", true)
7474
SUPPRESSIBLE_LANGUAGE_FEATURE(SpecializeAttributeWithAvailability, 0, "@_specialize attribute with availability", true)
7575
LANGUAGE_FEATURE(BuiltinAssumeAlignment, 0, "Builtin.assumeAlignment", true)
7676
SUPPRESSIBLE_LANGUAGE_FEATURE(UnsafeInheritExecutor, 0, "@_unsafeInheritExecutor", true)
77-
SUPPRESSIBLE_LANGUAGE_FEATURE(PrimaryAssociatedTypes, 346, "Primary associated types", true)
77+
SUPPRESSIBLE_LANGUAGE_FEATURE(PrimaryAssociatedTypes2, 346, "Primary associated types", true)
7878
SUPPRESSIBLE_LANGUAGE_FEATURE(UnavailableFromAsync, 0, "@_unavailableFromAsync", true)
7979
SUPPRESSIBLE_LANGUAGE_FEATURE(NoAsyncAvailability, 340, "@available(*, noasync)", true)
8080

lib/AST/ASTPrinter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2972,7 +2972,7 @@ static void suppressingFeatureUnsafeInheritExecutor(PrintOptions &options,
29722972
options.ExcludeAttrList.resize(originalExcludeAttrCount);
29732973
}
29742974

2975-
static bool usesFeaturePrimaryAssociatedTypes(Decl *decl) {
2975+
static bool usesFeaturePrimaryAssociatedTypes2(Decl *decl) {
29762976
if (auto *protoDecl = dyn_cast<ProtocolDecl>(decl)) {
29772977
if (protoDecl->getPrimaryAssociatedTypes().size() > 0)
29782978
return true;
@@ -2981,7 +2981,7 @@ static bool usesFeaturePrimaryAssociatedTypes(Decl *decl) {
29812981
return false;
29822982
}
29832983

2984-
static void suppressingFeaturePrimaryAssociatedTypes(PrintOptions &options,
2984+
static void suppressingFeaturePrimaryAssociatedTypes2(PrintOptions &options,
29852985
llvm::function_ref<void()> action) {
29862986
bool originalPrintPrimaryAssociatedTypes = options.PrintPrimaryAssociatedTypes;
29872987
options.PrintPrimaryAssociatedTypes = false;

test/ModuleInterface/parameterized-protocols.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public protocol HasPrimaryAssociatedTypes<T, U> {
77
associatedtype U : Equatable
88
}
99

10-
// CHECK: #if compiler(>=5.3) && $PrimaryAssociatedTypes
10+
// CHECK: #if compiler(>=5.3) && $PrimaryAssociatedTypes2
1111
// CHECK-NEXT: public protocol HasPrimaryAssociatedTypes<T, U> {
1212
// CHECK-NEXT: associatedtype T : Swift.Collection
1313
// CHECK-NEXT: associatedtype U : Swift.Equatable where Self.U == Self.T.Element

0 commit comments

Comments
 (0)