File tree Expand file tree Collapse file tree 1 file changed +51
-0
lines changed
Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change 1+ /// Guard that we don't reexport the SPIs accidentally through the common
2+ /// reexported imports between clang modules.
3+
4+ // RUN: %empty-directory(%t)
5+ // RUN: split-file %s %t
6+
7+ // RUN: %target-swift-frontend -emit-module %t/Overlayed.swift -I %t -o %t
8+ // RUN: %target-swift-frontend -typecheck -verify %t/Client.swift -I %t
9+ // RUN: %target-swift-frontend -typecheck -verify %t/LowerClient.swift -I %t
10+
11+ //--- module.modulemap
12+ module Overlayed {
13+ header " Overlayed.h "
14+ }
15+
16+ module Middle {
17+ header " Middle.h "
18+ export *
19+ }
20+
21+ module LowerMiddle {
22+ header " LowerMiddle.h "
23+ export *
24+ }
25+
26+ //--- Overlayed.h
27+ //--- Overlayed.swift
28+ @_exported import Overlayed
29+
30+ public func funcPublic( ) { }
31+
32+ @_spi ( X)
33+ public func funcSPI( ) { }
34+
35+ //--- Middle.h
36+ #include < Overlayed. h>
37+
38+ //--- LowerMiddle.h
39+ #include < Middle. h>
40+
41+ //--- Client.swift
42+ @_spi ( X) import Middle
43+
44+ funcPublic ( )
45+ funcSPI ( ) // expected-error {{cannot find 'funcSPI' in scope}}
46+
47+ //--- LowerClient.swift
48+ @_spi ( X) import LowerMiddle
49+
50+ funcPublic ( )
51+ funcSPI ( ) // expected-error {{cannot find 'funcSPI' in scope}}
You can’t perform that action at this time.
0 commit comments