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
@@ -158,6 +188,15 @@ public func explicitlyInlinable() {
158
188
// expected-error @-1 2 {{struct 'HiddenLayout' is private and cannot be referenced from an '@inlinable' function}}
159
189
// expected-error @-2 {{initializer 'init()' is private and cannot be referenced from an '@inlinable' function}}
160
190
191
+
let _:ExposedClassPublic=ExposedClassPublic()
192
+
let _:ExposedClassPrivate=ExposedClassPrivate()
193
+
// expected-error @-1 2 {{class 'ExposedClassPrivate' is private and cannot be referenced from an '@inlinable' function}}
194
+
// expected-error @-2 {{initializer 'init()' is private and cannot be referenced from an '@inlinable' function}}
195
+
196
+
let _:HiddenClass=HiddenClass()
197
+
// expected-error @-1 2 {{class 'HiddenClass' is private and cannot be referenced from an '@inlinable' function}}
198
+
// expected-error @-2 {{initializer 'init()' is private and cannot be referenced from an '@inlinable' function}}
199
+
161
200
let _:ExposedEnumPublic=ExposedEnumPublic.A
162
201
let _:ExposedEnumPrivate=ExposedEnumPrivate.A
163
202
// expected-error @-1 2 {{enum 'ExposedEnumPrivate' is private and cannot be referenced from an '@inlinable' function}}
@@ -181,6 +220,11 @@ public func implicitlyInlinablePublic() {
181
220
let _:HiddenLayout=HiddenLayout()
182
221
// expected-embedded-opt-in-error @-1 2 {{struct 'HiddenLayout' cannot be used in an embedded function not marked '@export(interface)' because 'HiddenLayout' is marked '@_implementationOnly'}}
183
222
223
+
let _:ExposedClassPublic=ExposedClassPublic()
224
+
let _:ExposedClassPrivate=ExposedClassPrivate()
225
+
let _:HiddenClass=HiddenClass()
226
+
// expected-embedded-opt-in-error @-1 2 {{class 'HiddenClass' cannot be used in an embedded function not marked '@export(interface)' because 'HiddenClass' is marked '@_implementationOnly'}}
// expected-embedded-opt-in-error @-1 2 {{struct 'HiddenLayout' cannot be used in an embedded function not marked '@export(interface)' because 'HiddenLayout' is marked '@_implementationOnly'}}
201
245
246
+
let _:ExposedClassPublic=ExposedClassPublic()
247
+
let _:ExposedClassPrivate=ExposedClassPrivate()
248
+
let _:HiddenClass=HiddenClass()
249
+
// expected-embedded-opt-in-error @-1 2 {{class 'HiddenClass' cannot be used in an embedded function not marked '@export(interface)' because 'HiddenClass' is marked '@_implementationOnly'}}
250
+
202
251
let _:ExposedEnumPublic=ExposedEnumPublic.A
203
252
let _:ExposedEnumPrivate=ExposedEnumPrivate.A
204
253
let _:HiddenEnum=HiddenEnum.A
@@ -216,6 +265,11 @@ public func explicitNonInliable() {
@@ -258,6 +317,12 @@ public struct ExposedLayoutPublicUser: ProtocolFromDirect {
258
317
privatevarc:HiddenLayout
259
318
// expected-opt-in-error @-1 {{cannot use struct 'HiddenLayout' in a property declaration marked public or in a '@frozen' or '@usableFromInline' context; 'HiddenLayout' is marked '@_implementationOnly'}}
260
319
320
+
privatevarca:ExposedClassPublic
321
+
privatevarcb:ExposedClassInternal
322
+
privatevarcc:ExposedClassPrivate
323
+
privatevarcd:HiddenClass
324
+
// expected-opt-in-error @-1 {{cannot use class 'HiddenClass' in a property declaration marked public or in a '@frozen' or '@usableFromInline' context; 'HiddenClass' is marked '@_implementationOnly'}}
325
+
261
326
privatevard:ExposedEnumPublic
262
327
privatevare:ExposedEnumPrivate
263
328
privatevarf:HiddenEnum
@@ -274,6 +339,8 @@ public struct ExposedLayoutPublicUser: ProtocolFromDirect {
274
339
275
340
privatefunc privateFunc(h:HiddenLayout){}
276
341
// expected-embedded-opt-in-error @-1 {{struct 'HiddenLayout' cannot be used in an embedded function not marked '@export(interface)' because 'HiddenLayout' is marked '@_implementationOnly'}}
342
+
privatefunc privateFuncClass(h:HiddenClass){}
343
+
// expected-embedded-opt-in-error @-1 {{class 'HiddenClass' cannot be used in an embedded function not marked '@export(interface)' because 'HiddenClass' is marked '@_implementationOnly'}}
// expected-opt-in-error @-1 {{cannot use struct 'HiddenLayout' in a property declaration marked public or in a '@frozen' or '@usableFromInline' context; 'HiddenLayout' is marked '@_implementationOnly'}}
290
357
358
+
privatevarca:ExposedClassPublic
359
+
privatevarcb:ExposedClassInternal
360
+
privatevarcc:ExposedClassPrivate
361
+
privatevarcd:HiddenClass
362
+
// expected-opt-in-error @-1 {{cannot use class 'HiddenClass' in a property declaration marked public or in a '@frozen' or '@usableFromInline' context; 'HiddenClass' is marked '@_implementationOnly'}}
// expected-embedded-opt-in-error @-1 {{struct 'HiddenLayout' cannot be used in an embedded function not marked '@export(interface)' because 'HiddenLayout' is marked '@_implementationOnly'}}
377
+
privatefunc privateFuncClass(h:HiddenClass){}
378
+
// expected-embedded-opt-in-error @-1 {{class 'HiddenClass' cannot be used in an embedded function not marked '@export(interface)' because 'HiddenClass' is marked '@_implementationOnly'}}
// expected-opt-in-error @-1 {{cannot use struct 'HiddenLayout' in a property declaration marked public or in a '@frozen' or '@usableFromInline' context; 'HiddenLayout' is marked '@_implementationOnly'}}
317
392
393
+
privatevarca:ExposedClassPublic
394
+
privatevarcb:ExposedClassInternal
395
+
privatevarcc:ExposedClassPrivate
396
+
privatevarcd:HiddenClass
397
+
// expected-opt-in-error @-1 {{cannot use class 'HiddenClass' in a property declaration marked public or in a '@frozen' or '@usableFromInline' context; 'HiddenClass' is marked '@_implementationOnly'}}
// expected-embedded-opt-in-error @-1 {{struct 'HiddenLayout' cannot be used in an embedded function not marked '@export(interface)' because 'HiddenLayout' is marked '@_implementationOnly'}}
412
+
privatefunc privateFuncClass(h:HiddenClass){}
413
+
// expected-embedded-opt-in-error @-1 {{class 'HiddenClass' cannot be used in an embedded function not marked '@export(interface)' because 'HiddenClass' is marked '@_implementationOnly'}}
// expected-error @-1 {{cannot use protocol 'ProtocolFromDirect' in a public or '@usableFromInline' conformance; 'directs' has been imported as implementation-only}}
448
561
449
562
publicinit(){fatalError()}
@@ -474,7 +587,7 @@ public class PublicClass: ProtocolFromDirect {
// expected-opt-in-error @-1 {{cannot use protocol 'ProtocolFromDirect' in a public or '@usableFromInline' conformance; 'directs' has been imported as implementation-only}}
479
592
480
593
publicinit(){fatalError()}
@@ -504,7 +617,7 @@ internal class InternalClass: ProtocolFromDirect {
504
617
privatefunc privateFunc(h:HiddenLayout){} // expected-embedded-opt-in-error {{struct 'HiddenLayout' cannot be used in an embedded function not marked '@export(interface)' because 'HiddenLayout' is marked '@_implementationOnly'}}
505
618
}
506
619
507
-
privateclassPrivateClass:ProtocolFromDirect{
620
+
privateclassPrivateClassUser:ProtocolFromDirect{
508
621
// expected-opt-in-error @-1 {{cannot use protocol 'ProtocolFromDirect' in a public or '@usableFromInline' conformance; 'directs' has been imported as implementation-only}}
509
622
510
623
publicinit(){fatalError()}
@@ -536,7 +649,7 @@ private class PrivateClass: ProtocolFromDirect {
536
649
537
650
#if UseImplementationOnly
538
651
@_implementationOnly
539
-
internalclassHiddenClass:ProtocolFromDirect{
652
+
internalclassHiddenClassUser:ProtocolFromDirect{
540
653
publicinit(){fatalError()}
541
654
542
655
publicvarpublicField:StructFromDirect
@@ -547,6 +660,11 @@ internal class HiddenClass: ProtocolFromDirect {
0 commit comments