Skip to content

Commit e0fd889

Browse files
committed
test: add a test for using SPI in inlinable function body
1 parent 3ca3e05 commit e0fd889

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/Sema/spi-available-inline.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// REQUIRES: VENDOR=apple
2+
// RUN: %target-typecheck-verify-swift -target x86_64-apple-macosx11.9
3+
4+
@_spi_available(macOS 10.4, *)
5+
public class MacOSSPIClass { public init() {} }
6+
7+
@_spi_available(iOS 8.0, *)
8+
public class iOSSPIClass { public init() {} }
9+
10+
@inlinable public func foo() {
11+
_ = MacOSSPIClass() // expected-error {{class 'MacOSSPIClass' cannot be used in an '@inlinable' function because it is SPI}}
12+
_ = iOSSPIClass()
13+
}

0 commit comments

Comments
 (0)