mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This is an attribute that gets put on an import in library FooKit to keep it from being a requirement to import FooKit. It's not checked at all, meaning that in this form it is up to the author of FooKit to make sure nothing in its API or ABI depends on the implementation-only dependency. There's also no debugging support here (debugging FooKit /should/ import the implementation-only dependency if it's present). The goal is to get to a point where it /can/ be checked, i.e. FooKit developers are prevented from writing code that would rely on FooKit's implementation-only dependency being present when compiling clients of FooKit. But right now it's not. rdar://problem/48985979
27 lines
1.5 KiB
Swift
27 lines
1.5 KiB
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: mkdir %t/a %t/b %t/c %t/d %t/e
|
|
// RUN: %target-swift-frontend -emit-module -o %t/a/A.swiftmodule %S/../Inputs/empty.swift
|
|
// RUN: %target-swift-frontend -emit-module -o %t/b/B.swiftmodule %S/../Inputs/empty.swift
|
|
// RUN: %target-swift-frontend -emit-module -o %t/c/C.swiftmodule %S/../Inputs/empty.swift
|
|
// RUN: %target-swift-frontend -emit-module -o %t/d/D.swiftmodule %S/../Inputs/empty.swift
|
|
// RUN: %target-swift-frontend -emit-module -o %t/e/E.swiftmodule %S/../Inputs/empty.swift
|
|
|
|
// RUN: %target-swift-frontend -emit-module -o %t/Library.swiftmodule %s %S/Inputs/import-multi-file-other.swift -I %t/a -I %t/b -I %t/c -I %t/d -I %t/e
|
|
|
|
// RUN: echo "import Library" > %t/main.swift
|
|
// RUN: %target-swift-frontend -typecheck %t/main.swift -I %t -I %t/a -I %t/b -I %t/c -I %t/d -I %t/e
|
|
|
|
// We should be able to drop "E", which is implementation-only imported in both
|
|
// files, but not any of the others.
|
|
// RUN: %target-swift-frontend -typecheck %t/main.swift -I %t -I %t/a -I %t/b -I %t/c -I %t/d
|
|
// RUN: not %target-swift-frontend -typecheck %t/main.swift -I %t -I %t/a -I %t/b -I %t/c -I %t/e
|
|
// RUN: not %target-swift-frontend -typecheck %t/main.swift -I %t -I %t/a -I %t/b -I %t/d -I %t/e
|
|
// RUN: not %target-swift-frontend -typecheck %t/main.swift -I %t -I %t/a -I %t/c -I %t/d -I %t/e
|
|
// RUN: not %target-swift-frontend -typecheck %t/main.swift -I %t -I %t/b -I %t/c -I %t/d -I %t/e
|
|
|
|
import A
|
|
@_implementationOnly import B
|
|
@_exported import C
|
|
@_implementationOnly import D
|
|
@_implementationOnly import E
|