mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add regression test for rdar://152700122
This commit is contained in:
@@ -29,3 +29,20 @@ func testAvailability() {
|
||||
_ = (1 as Int32) <=< (1 as Int32) // okay
|
||||
_ = (1 as Int32) >=> (1 as Int32) // expected-error{{'>=>' is unavailable}}
|
||||
}
|
||||
|
||||
// rdar://problem/152700122
|
||||
infix operator ~>
|
||||
public func ~><T> (lhs: T, rhs: (T) -> Void) -> T {
|
||||
fatalError()
|
||||
}
|
||||
|
||||
struct S {
|
||||
@available(macOS 20, *)
|
||||
func f() {}
|
||||
}
|
||||
|
||||
let s = S() ~> {
|
||||
if #available(macOS 20.0, *) {
|
||||
$0.f()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user