File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,16 @@ func overloadedSame() async -> String { "asynchronous" }
1717func overloaded( ) -> String { " synchronous " }
1818func overloaded( ) async -> Double { 3.14159 }
1919
20+ @available ( swift, deprecated: 4.0 , message: " synchronous is no fun " )
21+ func overloadedOptDifference( ) -> String { " synchronous " }
22+
23+ func overloadedOptDifference( ) async -> String ? { nil }
24+
2025func testOverloadedSync( ) {
2126 _ = overloadedSame ( ) // expected-warning{{synchronous is no fun}}
2227
28+ let _: String ? = overloadedOptDifference ( ) // expected-warning{{synchronous is no fun}}
29+
2330 let _ = overloaded ( )
2431 let fn = {
2532 overloaded ( )
@@ -47,6 +54,8 @@ func testOverloadedSync() {
4754func testOverloadedAsync( ) async {
4855 _ = await overloadedSame ( ) // no warning
4956
57+ let _: String ? = await overloadedOptDifference ( ) // no warning
58+
5059 let _ = await overloaded ( )
5160 let _ = overloaded ( ) // expected-error{{call is 'async' but is not marked with 'await'}}
5261
You can’t perform that action at this time.
0 commit comments