You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/SPI/spi-only-import-exportability.swift
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -118,6 +118,7 @@ public func publicInlinableUser() {
118
118
119
119
letp:PublicType=PublicType()
120
120
p.spiOnlyExtensionMethod() // expected-error {{instance method 'spiOnlyExtensionMethod()' cannot be used in an '@inlinable' function because 'SPIOnlyImportedLib' was imported for SPI only}}
121
+
conformanceUse(p) // expected-error{{cannot use conformance of 'PublicType' to 'PublicProtocol' here; 'SPIOnlyImportedLib' was imported for SPI only}}
121
122
}
122
123
#endif
123
124
@@ -131,6 +132,7 @@ public func spiInlinableUser() {
131
132
132
133
letp:PublicType=PublicType()
133
134
p.spiOnlyExtensionMethod()
135
+
conformanceUse(p)
134
136
}
135
137
136
138
publicfunc implementationDetailsUser(){
@@ -142,6 +144,7 @@ public func implementationDetailsUser() {
/// The swiftinterface is broken by the missing import without the workaround.
@@ -101,6 +102,20 @@ import Aliases
101
102
publicfunc takesGeneric<T:ProtoAlias>(_ t:T){}
102
103
103
104
105
+
//--- UsesAliasesSPIOnlyImport.swift
106
+
107
+
import Aliases
108
+
@_spiOnlyimport Original
109
+
110
+
@inlinablepublicfunc inlinableFunc(){
111
+
// expected-error@+1 {{'StructAlias' aliases 'Original.Struct' and cannot be used in an '@inlinable' function because 'Original' was imported for SPI only}}
112
+
_ =StructAlias.self
113
+
}
114
+
115
+
// expected-error@+1 {{'ProtoAlias' aliases 'Original.Proto' and cannot be used here because 'Original' was imported for SPI only}}
0 commit comments