Skip to content

Commit 11ef9bd

Browse files
authored
Merge pull request swiftlang#32217 from bitjammer/acgarland/rdar-63120829-show-in-interface-not-underscored
[SymbolGraph] Don't consider @show_in_interface for underscored names
2 parents 81483cc + c647c11 commit 11ef9bd

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/AST/Decl.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -738,9 +738,6 @@ bool Decl::hasUnderscoredNaming() const {
738738
}
739739

740740
if (const auto PD = dyn_cast<ProtocolDecl>(D)) {
741-
if (PD->getAttrs().hasAttribute<ShowInInterfaceAttr>()) {
742-
return false;
743-
}
744741
StringRef NameStr = PD->getNameStr();
745742
if (NameStr.startswith("_Builtin")) {
746743
return true;
@@ -797,6 +794,10 @@ bool Decl::isPrivateStdlibDecl(bool treatNonBuiltinProtocolsAsPublic) const {
797794
return false;
798795
}
799796

797+
if (D->getAttrs().hasAttribute<ShowInInterfaceAttr>()) {
798+
return false;
799+
}
800+
800801
return hasUnderscoredNaming();
801802
}
802803

test/SymbolGraph/Symbols/SkipsPublicUnderscore.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ public protocol PublicProtocol {}
77

88
// CHECK-NOT: precise:{{.*}}_ProtocolShouldntAppear
99
// CHECK-NOT: precise:{{.*}}PublicProtocol
10+
@_show_in_interface
1011
public protocol _ProtocolShouldntAppear {}
1112

1213
// CHECK-NOT: _ShouldntAppear

0 commit comments

Comments
 (0)