|
| 1 | +// REQUIRES: OS=macosx |
| 2 | +// RUN: %empty-directory(%t) |
| 3 | +// RUN: mkdir -p %t/Modules |
| 4 | +// RUN: split-file %s %t |
| 5 | + |
| 6 | +// Build the project internal module |
| 7 | +// RUN: %target-swift-frontend %t/ProjectInternal.swift \ |
| 8 | +// RUN: -emit-module -module-name ProjectInternal \ |
| 9 | +// RUN: -o %t/Modules/ProjectInternal.swiftmodule \ |
| 10 | +// RUN: -disable-experimental-string-processing |
| 11 | + |
| 12 | +// Build MyModule with search path to the project internal module |
| 13 | +// RUN: %target-swift-frontend %t/MyModule.swift \ |
| 14 | +// RUN: -emit-module -module-name MyModule \ |
| 15 | +// RUN: -o %t/Modules/MyModule.swiftmodule \ |
| 16 | +// RUN: -I %t/Modules -disable-experimental-string-processing |
| 17 | + |
| 18 | +// Remove the project internal module as it's not available to clients of MyModule |
| 19 | +// RUN: rm %t/Modules/ProjectInternal.swiftmodule |
| 20 | + |
| 21 | +// Use swift-api-extract to load MyModule without ProjectInternal |
| 22 | +// RUN: %target-swift-api-extract -o - -pretty-print \ |
| 23 | +// RUN: -module-name MyModule -I %t/Modules |
| 24 | + |
| 25 | +//--- ProjectInternal.swift |
| 26 | +public class ProjectInternalClass {} |
| 27 | + |
| 28 | +//--- MyModule.swift |
| 29 | +@_implementationOnly import ProjectInternal |
| 30 | + |
| 31 | +public protocol PublicProtocol {} |
| 32 | + |
| 33 | +extension ProjectInternalClass : PublicProtocol {} |
| 34 | + |
| 35 | +internal protocol InternalProtocol { |
| 36 | + associatedtype T : PublicProtocol |
| 37 | + static var v : [T] { get } |
| 38 | +} |
| 39 | + |
| 40 | +public class PublicClass {} |
| 41 | + |
| 42 | +extension PublicClass : InternalProtocol { |
| 43 | + static let v : [ProjectInternalClass] = [] |
| 44 | +} |
0 commit comments