|
35 | 35 |
|
36 | 36 | //--- SPIOnly_IOI_Exported.swift
|
37 | 37 | @_spiOnly @_implementationOnly @_exported import Lib // expected-error {{module 'Lib' cannot be both exported and implementation-only}}
|
| 38 | + |
| 39 | +/// Access levels on imports |
| 40 | +// RUN: %target-swift-frontend -typecheck %t/Public_Exported.swift -I %t -verify \ |
| 41 | +// RUN: -experimental-spi-only-imports -verify \ |
| 42 | +// RUN: -enable-experimental-feature AccessLevelOnImport |
| 43 | +// RUN: %target-swift-frontend -typecheck %t/Package_Exported.swift -I %t -verify \ |
| 44 | +// RUN: -experimental-spi-only-imports -verify \ |
| 45 | +// RUN: -enable-experimental-feature AccessLevelOnImport |
| 46 | +// RUN: %target-swift-frontend -typecheck %t/Internal_Exported.swift -I %t -verify \ |
| 47 | +// RUN: -experimental-spi-only-imports -verify \ |
| 48 | +// RUN: -enable-experimental-feature AccessLevelOnImport |
| 49 | +// RUN: %target-swift-frontend -typecheck %t/Fileprivate_Exported.swift -I %t -verify \ |
| 50 | +// RUN: -experimental-spi-only-imports -verify \ |
| 51 | +// RUN: -enable-experimental-feature AccessLevelOnImport |
| 52 | +// RUN: %target-swift-frontend -typecheck %t/Private_Exported.swift -I %t -verify \ |
| 53 | +// RUN: -experimental-spi-only-imports -verify \ |
| 54 | +// RUN: -enable-experimental-feature AccessLevelOnImport |
| 55 | + |
| 56 | +//--- Public_Exported.swift |
| 57 | +@_exported public import Lib |
| 58 | + |
| 59 | +//--- Package_Exported.swift |
| 60 | +@_exported package import Lib // expected-error {{'@_exported' is incompatible with 'package'; it can only be applied to public imports}} |
| 61 | + |
| 62 | +//--- Internal_Exported.swift |
| 63 | +@_exported internal import Lib // expected-error {{'@_exported' is incompatible with 'internal'; it can only be applied to public imports}} |
| 64 | + |
| 65 | +//--- Fileprivate_Exported.swift |
| 66 | +@_exported fileprivate import Lib // expected-error {{'@_exported' is incompatible with 'fileprivate'; it can only be applied to public imports}} |
| 67 | + |
| 68 | +//--- Private_Exported.swift |
| 69 | +@_exported private import Lib // expected-error {{'@_exported' is incompatible with 'private'; it can only be applied to public imports}} |
0 commit comments