mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
For executable targets or private libraries, using SPI_AVAILABLE symbols should be allowed. rdar://91088241
15 lines
478 B
Swift
15 lines
478 B
Swift
// REQUIRES: VENDOR=apple
|
|
// REQUIRES: OS=macosx
|
|
// RUN: %target-typecheck-verify-swift -target %target-cpu-apple-macosx11.9 -library-level api
|
|
|
|
@_spi_available(macOS 10.4, *)
|
|
public class MacOSSPIClass { public init() {} }
|
|
|
|
@_spi_available(iOS 8.0, *)
|
|
public class iOSSPIClass { public init() {} }
|
|
|
|
@inlinable public func foo() {
|
|
_ = MacOSSPIClass() // expected-error {{class 'MacOSSPIClass' cannot be used in an '@inlinable' function because it is SPI}}
|
|
_ = iOSSPIClass()
|
|
}
|