Skip to content

ASTPrinter: Rename PrimaryAssociatedTypes feature to PrimaryAssociatedTypes2 #42308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/swift/Basic/Features.def
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ LANGUAGE_FEATURE(BuiltinStackAlloc, 0, "Builtin.stackAlloc", true)
SUPPRESSIBLE_LANGUAGE_FEATURE(SpecializeAttributeWithAvailability, 0, "@_specialize attribute with availability", true)
LANGUAGE_FEATURE(BuiltinAssumeAlignment, 0, "Builtin.assumeAlignment", true)
SUPPRESSIBLE_LANGUAGE_FEATURE(UnsafeInheritExecutor, 0, "@_unsafeInheritExecutor", true)
SUPPRESSIBLE_LANGUAGE_FEATURE(PrimaryAssociatedTypes, 346, "Primary associated types", true)
SUPPRESSIBLE_LANGUAGE_FEATURE(PrimaryAssociatedTypes2, 346, "Primary associated types", true)
SUPPRESSIBLE_LANGUAGE_FEATURE(UnavailableFromAsync, 0, "@_unavailableFromAsync", true)
SUPPRESSIBLE_LANGUAGE_FEATURE(NoAsyncAvailability, 340, "@available(*, noasync)", true)

Expand Down
4 changes: 2 additions & 2 deletions lib/AST/ASTPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2972,7 +2972,7 @@ static void suppressingFeatureUnsafeInheritExecutor(PrintOptions &options,
options.ExcludeAttrList.resize(originalExcludeAttrCount);
}

static bool usesFeaturePrimaryAssociatedTypes(Decl *decl) {
static bool usesFeaturePrimaryAssociatedTypes2(Decl *decl) {
if (auto *protoDecl = dyn_cast<ProtocolDecl>(decl)) {
if (protoDecl->getPrimaryAssociatedTypes().size() > 0)
return true;
Expand All @@ -2981,7 +2981,7 @@ static bool usesFeaturePrimaryAssociatedTypes(Decl *decl) {
return false;
}

static void suppressingFeaturePrimaryAssociatedTypes(PrintOptions &options,
static void suppressingFeaturePrimaryAssociatedTypes2(PrintOptions &options,
llvm::function_ref<void()> action) {
bool originalPrintPrimaryAssociatedTypes = options.PrintPrimaryAssociatedTypes;
options.PrintPrimaryAssociatedTypes = false;
Expand Down
2 changes: 1 addition & 1 deletion test/ModuleInterface/parameterized-protocols.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public protocol HasPrimaryAssociatedTypes<T, U> {
associatedtype U : Equatable
}

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