File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1- // RUN: %target-typecheck-verify-swift
1+ // RUN: %target-typecheck-verify-swift -swift-version 5
22
33func f0( _ i: Int , _ d: Double ) { } // expected-note{{found this candidate}}
44func f0( _ d: Double , _ i: Int ) { } // expected-note{{found this candidate}}
@@ -43,7 +43,7 @@ func rdar29907555(_ value: Any!) -> String {
4343}
4444
4545struct SR3715 {
46- var overloaded : Int !
46+ var overloaded : Int ! // expected-note {{implicitly unwrapped property 'overloaded' declared here}}
4747
4848 func overloaded( _ x: Int ) { }
4949 func overloaded( _ x: Float ) { }
@@ -52,6 +52,10 @@ struct SR3715 {
5252
5353 func test( ) {
5454 take ( [ overloaded] )
55+ // expected-warning@-1 {{coercion of implicitly unwrappable value of type 'Int?' to 'Any' does not unwrap optional}}
56+ // expected-note@-2 {{provide a default value to avoid this warning}}
57+ // expected-note@-3 {{force-unwrap the value to avoid this warning}}
58+ // expected-note@-4 {{explicitly cast to 'Any' with 'as Any' to silence this warning}}
5559 }
5660}
5761
You can’t perform that action at this time.
0 commit comments