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
2
2
3
3
func f0( _ i: Int , _ d: Double ) { } // expected-note{{found this candidate}}
4
4
func f0( _ d: Double , _ i: Int ) { } // expected-note{{found this candidate}}
@@ -43,7 +43,7 @@ func rdar29907555(_ value: Any!) -> String {
43
43
}
44
44
45
45
struct SR3715 {
46
- var overloaded : Int !
46
+ var overloaded : Int ! // expected-note {{implicitly unwrapped property 'overloaded' declared here}}
47
47
48
48
func overloaded( _ x: Int ) { }
49
49
func overloaded( _ x: Float ) { }
@@ -52,6 +52,10 @@ struct SR3715 {
52
52
53
53
func test( ) {
54
54
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}}
55
59
}
56
60
}
57
61
You can’t perform that action at this time.
0 commit comments