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" }
17
17
func overloaded( ) -> String { " synchronous " }
18
18
func overloaded( ) async -> Double { 3.14159 }
19
19
20
+ @available ( swift, deprecated: 4.0 , message: " synchronous is no fun " )
21
+ func overloadedOptDifference( ) -> String { " synchronous " }
22
+
23
+ func overloadedOptDifference( ) async -> String ? { nil }
24
+
20
25
func testOverloadedSync( ) {
21
26
_ = overloadedSame ( ) // expected-warning{{synchronous is no fun}}
22
27
28
+ let _: String ? = overloadedOptDifference ( ) // expected-warning{{synchronous is no fun}}
29
+
23
30
let _ = overloaded ( )
24
31
let fn = {
25
32
overloaded ( )
@@ -47,6 +54,8 @@ func testOverloadedSync() {
47
54
func testOverloadedAsync( ) async {
48
55
_ = await overloadedSame ( ) // no warning
49
56
57
+ let _: String ? = await overloadedOptDifference ( ) // no warning
58
+
50
59
let _ = await overloaded ( )
51
60
let _ = overloaded ( ) // expected-error{{call is 'async' but is not marked with 'await'}}
52
61
You can’t perform that action at this time.
0 commit comments