Skip to content

Commit 7c78224

Browse files
committed
Add regression test for rdar://152700122
1 parent 9c01ee2 commit 7c78224

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/Availability/operator_availability.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,20 @@ func testAvailability() {
2929
_ = (1 as Int32) <=< (1 as Int32) // okay
3030
_ = (1 as Int32) >=> (1 as Int32) // expected-error{{'>=>' is unavailable}}
3131
}
32+
33+
// rdar://problem/152700122
34+
infix operator ~>
35+
public func ~><T> (lhs: T, rhs: (T) -> Void) -> T {
36+
fatalError()
37+
}
38+
39+
struct S {
40+
@available(macOS 20, *)
41+
func f() {}
42+
}
43+
44+
let s = S() ~> {
45+
if #available(macOS 20.0, *) {
46+
$0.f()
47+
}
48+
}

0 commit comments

Comments
 (0)