Skip to content

Commit 0375994

Browse files
authored
Merge pull request #4920 from rudkx/add-fixit-tests
2 parents b0e3c0b + fb3bd9e commit 0375994

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/Sema/diag_optional_to_any.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ func throwing() throws -> Int? {}
88

99
func warnOptionalToAnyCoercion(value x: Int?) -> Any {
1010
let a: Any = x // expected-warning {{expression implicitly coerced from 'Int?' to Any}}
11-
// expected-note@-1 {{provide a default value to avoid this warning}}
12-
// expected-note@-2 {{force-unwrap the value to avoid this warning}}
13-
// expected-note@-3 {{explicitly cast to Any with 'as Any' to silence this warning}}
11+
// expected-note@-1 {{provide a default value to avoid this warning}}{{17-17= ?? <#default value#>}}
12+
// expected-note@-2 {{force-unwrap the value to avoid this warning}}{{17-17=!}}
13+
// expected-note@-3 {{explicitly cast to Any with 'as Any' to silence this warning}}{{17-17= as Any}}
1414

1515
let b: Any = x as Any
1616

@@ -35,9 +35,9 @@ func warnOptionalToAnyCoercion(value x: Int?) -> Any {
3535
// expected-note@-3 {{explicitly cast to Any with 'as Any' to silence this warning}}
3636

3737
let _: Any = takeAny(f as? Int, g) as Any // expected-warning {{expression implicitly coerced from 'Int?' to Any}}
38-
// expected-note@-1 {{provide a default value to avoid this warning}}
39-
// expected-note@-2 {{force-unwrap the value to avoid this warning}}
40-
// expected-note@-3 {{explicitly cast to Any with 'as Any' to silence this warning}}
38+
// expected-note@-1 {{provide a default value to avoid this warning}}{{33-33= ?? <#default value#>}}
39+
// expected-note@-2 {{force-unwrap the value to avoid this warning}}{{33-33=!}}
40+
// expected-note@-3 {{explicitly cast to Any with 'as Any' to silence this warning}}{{33-33= as Any}}
4141

4242
let _: Any = takeAny(f as? Int as Any, g) as Any
4343

0 commit comments

Comments
 (0)