File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -230,7 +230,7 @@ void ModuleNameLookup<LookupStrategy>::lookupInModule(
230
230
if (import .importedModule == headerImportModule)
231
231
continue ;
232
232
233
- visitImport (import , nullptr );
233
+ visitImport (import , moduleScopeContext );
234
234
}
235
235
}
236
236
Original file line number Diff line number Diff line change
1
+ /// Test @_spi and @_exported 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: %target-swift-frontend -typecheck -DCLIENT_EXTERNAL %s -I %t -verify
7
+
8
+ #if LIB_A
9
+
10
+ @_spi ( A) public func spiFunc( ) { }
11
+
12
+ @_spi ( A) public struct SPIStruct {
13
+ public init ( ) { }
14
+ }
15
+
16
+ #elseif LIB_B
17
+
18
+ @_exported import A
19
+ @_spi ( A) import A
20
+
21
+ spiFunc ( ) // OK
22
+ let x = SPIStruct ( ) // OK
23
+
24
+ #elseif CLIENT_EXTERNAL
25
+
26
+ import B
27
+
28
+ spiFunc ( ) // expected-error{{cannot find 'spiFunc' in scope}}
29
+ let x = SPIStruct ( ) // expected-error{{cannot find 'SPIStruct' in scope}}
30
+
31
+ #endif
You can’t perform that action at this time.
0 commit comments