File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,9 @@ func throwing() throws -> Int? {}
8
8
9
9
func warnOptionalToAnyCoercion( value x: Int ? ) -> Any {
10
10
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}}
14
14
15
15
let b : Any = x as Any
16
16
@@ -35,9 +35,9 @@ func warnOptionalToAnyCoercion(value x: Int?) -> Any {
35
35
// expected-note@-3 {{explicitly cast to Any with 'as Any' to silence this warning}}
36
36
37
37
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}}
41
41
42
42
let _: Any = takeAny ( f as? Int as Any , g) as Any
43
43
You can’t perform that action at this time.
0 commit comments