Skip to content

Commit 8e70e1c

Browse files
authored
Merge pull request #59832 from hborla/update-diag-ambiguities
[NFC][Test] Update Constraints/diag_ambiguities.swift for Swift version 5.
2 parents 19b27c5 + 6eb53b5 commit 8e70e1c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/Constraints/diag_ambiguities.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift
1+
// RUN: %target-typecheck-verify-swift -swift-version 5
22

33
func f0(_ i: Int, _ d: Double) {} // expected-note{{found this candidate}}
44
func f0(_ d: Double, _ i: Int) {} // expected-note{{found this candidate}}
@@ -43,7 +43,7 @@ func rdar29907555(_ value: Any!) -> String {
4343
}
4444

4545
struct 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

0 commit comments

Comments
 (0)