File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -997,7 +997,9 @@ void PrintAST::printAttributes(const Decl *D) {
997
997
}
998
998
999
999
// SPI groups
1000
- if (Options.PrintSPIs ) {
1000
+ if (Options.PrintSPIs &&
1001
+ DeclAttribute::canAttributeAppearOnDeclKind (
1002
+ DAK_SPIAccessControl, D->getKind ())) {
1001
1003
interleave (D->getSPIGroups (),
1002
1004
[&](Identifier spiName) {
1003
1005
Printer.printAttrName (" _spi" , true );
Original file line number Diff line number Diff line change @@ -88,6 +88,20 @@ private class PrivateClassLocal {}
88
88
// CHECK-PUBLIC-NOT: extensionSPIMethod
89
89
}
90
90
91
+ @_spi ( LocalSPI) public protocol SPIProto3 {
92
+ // CHECK-PRIVATE: @_spi(LocalSPI) public protocol SPIProto3
93
+ // CHECK-PUBLIC-NOT: SPIProto3
94
+
95
+ associatedtype AssociatedType
96
+ // CHECK-PRIVATE: associatedtype AssociatedType
97
+ // CHECK-PRIVATE-NOT: @_spi(LocalSPI) associatedtype AssociatedType
98
+ // CHECK-PUBLIC-NOT: AssociatedType
99
+
100
+ func implicitSPIMethod( )
101
+ // CHECK-PRIVATE: @_spi(LocalSPI) func implicitSPIMethod()
102
+ // CHECK-PUBLIC-NOT: implicitSPIMethod
103
+ }
104
+
91
105
// Test the dummy conformance printed to replace private types used in
92
106
// conditional conformances. rdar://problem/63352700
93
107
You can’t perform that action at this time.
0 commit comments