We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4124693 commit 480e893Copy full SHA for 480e893
test/SPI/implementation_only_spi_import.swift
@@ -0,0 +1,23 @@
1
+/// @_implementationOnly imports should be compatible with @_spi imports
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: rm %t/A.swiftmodule
7
+// RUN: %target-swift-frontend -typecheck -verify -DLIB_C %s -I %t
8
9
+#if LIB_A
10
11
+@_spi(A) public func foo() {}
12
13
+#elseif LIB_B
14
15
+@_spi(A) @_implementationOnly import A
16
+foo() // OK
17
18
+#elseif LIB_C
19
20
+import B
21
+foo() // expected-error{{use of unresolved identifier}}
22
23
+#endif
0 commit comments