File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -2015,4 +2015,4 @@ refs/tags/swift-5.3-DEVELOPMENT-SNAPSHOT-2020-09-06-a: 539017b61d4fd33e72f269983
2015
2015
refs/tags/swift-5.3-DEVELOPMENT-SNAPSHOT-2020-09-07-a: 30277ea9d7139d33bf3a0b476c9f05f7140a17f0
2016
2016
refs/tags/swift-5.3-DEVELOPMENT-SNAPSHOT-2020-09-09-a: e1eb555e1b2365ec8b0252d9d7edec351f40f9ca
2017
2017
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2020-09-11-a: 48ed530cc4805b5f29fc519ec25ed290e058e674
2018
- refs/heads/main: 480e8933d7fbe6ce55ab605d2835ea1541852824
2018
+ refs/heads/main: 2b5fc3a8d7714b636f6958068dcc58d8de49c512
Original file line number Diff line number Diff line change
1
+ /// A module should be able to leak SPI types from an import through SPI decls
2
+
3
+ // RUN: %empty-directory(%t)
4
+ // RUN: %target-swift-frontend -emit-module -DLIB_A %s -module-name A -emit-module-path %t/A.swiftmodule
5
+ // RUN: %target-swift-frontend -emit-module -DLIB_B %s -module-name B -emit-module-path %t/B.swiftmodule -I %t
6
+ // RUN: %target-swift-frontend -typecheck -verify -verify-ignore-unknown -DLIB_C %s -I %t
7
+
8
+ #if LIB_A
9
+
10
+ @_spi ( A) public struct SecretStruct {
11
+ @_spi ( A) public func bar( ) { }
12
+ }
13
+
14
+ #elseif LIB_B
15
+
16
+ @_spi ( A) import A
17
+
18
+ @_spi ( B) public func foo( ) -> SecretStruct { fatalError ( ) }
19
+
20
+ #elseif LIB_C
21
+
22
+ @_spi ( B) import B
23
+
24
+ var a = foo ( ) // OK
25
+ a. bar ( ) // expected-error{{'bar' is inaccessible due to '@_spi' protection level}}
26
+
27
+ var b = SecretStruct ( ) // expected-error{{use of unresolved identifier}}
28
+
29
+ #endif
You can’t perform that action at this time.
0 commit comments