mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
16 lines
391 B
Swift
16 lines
391 B
Swift
// RUN: %target-typecheck-verify-swift -swift-version 5
|
|
|
|
func testNonacceptedClosures() {
|
|
let fn = { @usableFromInline in // expected-error{{'usableFromInline' is not supported on a closure}}
|
|
"hello"
|
|
}
|
|
|
|
let fn2: (Int) -> Int = { @usableFromInline x in // expected-error{{'usableFromInline' is not supported on a closure}}
|
|
print("hello")
|
|
return x
|
|
}
|
|
|
|
_ = fn
|
|
_ = fn2
|
|
}
|