You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_ =takeAny(a, b) // expected-warning {{coercion of implicitly unwrappable value of type 'Int?' to 'Any' does not unwrap optional}}
32
32
// expected-note@-1 {{provide a default value to avoid this warning}}{{16-16= ?? <#default value#>}}
33
33
// expected-note@-2 {{force-unwrap the value to avoid this warning}}{{16-16=!}}
34
34
// expected-note@-3 {{explicitly cast to 'Any' with 'as Any' to silence this warning}}{{16-16= as Any}}
35
-
// expected-warning@-4 {{expression implicitly coerced from 'Any??' to 'Any'}}
35
+
// expected-warning@-4 {{coercion of implicitly unwrappable value of type 'Any??' to 'Any' does not unwrap optional}}
36
36
// expected-note@-5 {{force-unwrap the value to avoid this warning}}{{19-19=!!}}
37
37
// expected-note@-6 {{explicitly cast to 'Any' with 'as Any' to silence this warning}}{{19-19= as Any}}
38
-
_ =takeAny(returningIUO(),C().returningIUO()) // expected-warning {{expression implicitly coerced from 'Int?' to 'Any'}}
38
+
_ =takeAny(returningIUO(),C().returningIUO()) // expected-warning {{coercion of implicitly unwrappable value of type 'Int?' to 'Any' does not unwrap optional}}
39
39
// expected-note@-1 {{provide a default value to avoid this warning}}{{29-29= ?? <#default value#>}}
40
40
// expected-note@-2 {{force-unwrap the value to avoid this warning}}{{29-29=!}}
41
41
// expected-note@-3 {{explicitly cast to 'Any' with 'as Any' to silence this warning}}{{29-29= as Any}}
42
-
// expected-warning@-4 {{expression implicitly coerced from 'Int?' to 'Any'}}
42
+
// expected-warning@-4 {{coercion of implicitly unwrappable value of type 'Int?' to 'Any' does not unwrap optional}}
43
43
// expected-note@-5 {{provide a default value to avoid this warning}}{{49-49= ?? <#default value#>}}
44
44
// expected-note@-6 {{force-unwrap the value to avoid this warning}}{{49-49=!}}
45
45
// expected-note@-7 {{explicitly cast to 'Any' with 'as Any' to silence this warning}}{{49-49= as Any}}
46
-
_ =takeAny(C().a,C().b) // expected-warning {{expression implicitly coerced from 'Int?' to 'Any'}}
46
+
_ =takeAny(C().a,C().b) // expected-warning {{coercion of implicitly unwrappable value of type 'Int?' to 'Any' does not unwrap optional}}
47
47
// expected-note@-1 {{provide a default value to avoid this warning}}{{20-20= ?? <#default value#>}}
48
48
// expected-note@-2 {{force-unwrap the value to avoid this warning}}{{20-20=!}}
49
49
// expected-note@-3 {{explicitly cast to 'Any' with 'as Any' to silence this warning}}{{20-20= as Any}}
50
-
// expected-warning@-4 {{expression implicitly coerced from 'Any??' to 'Any'}}
50
+
// expected-warning@-4 {{coercion of implicitly unwrappable value of type 'Any??' to 'Any' does not unwrap optional}}
51
51
// expected-note@-5 {{force-unwrap the value to avoid this warning}}{{27-27=!!}}
52
52
// expected-note@-6 {{explicitly cast to 'Any' with 'as Any' to silence this warning}}{{27-27= as Any}}
53
-
_ =takeAny(C()[0],C()[1.0]) // expected-warning {{expression implicitly coerced from 'Int?' to 'Any'}}
53
+
_ =takeAny(C()[0],C()[1.0]) // expected-warning {{coercion of implicitly unwrappable value of type 'Int?' to 'Any' does not unwrap optional}}
54
54
// expected-note@-1 {{provide a default value to avoid this warning}}{{21-21= ?? <#default value#>}}
55
55
// expected-note@-2 {{force-unwrap the value to avoid this warning}}{{21-21=!}}
56
56
// expected-note@-3 {{explicitly cast to 'Any' with 'as Any' to silence this warning}}{{21-21= as Any}}
57
-
// expected-warning@-4 {{expression implicitly coerced from 'Any?' to 'Any'}}
57
+
// expected-warning@-4 {{coercion of implicitly unwrappable value of type 'Any?' to 'Any' does not unwrap optional}}
58
58
// expected-note@-5 {{provide a default value to avoid this warning}}{{31-31= ?? <#default value#>}}
59
59
// expected-note@-6 {{force-unwrap the value to avoid this warning}}{{31-31=!}}
60
60
// expected-note@-7 {{explicitly cast to 'Any' with 'as Any' to silence this warning}}{{31-31= as Any}}
61
-
_ =takeAny(D(),D()) // expected-warning {{expression implicitly coerced from 'D?' to 'Any'}}
61
+
_ =takeAny(D(),D()) // expected-warning {{coercion of implicitly unwrappable value of type 'D?' to 'Any' does not unwrap optional}}
62
62
// expected-note@-1 {{provide a default value to avoid this warning}}{{18-18= ?? <#default value#>}}
63
63
// expected-note@-2 {{force-unwrap the value to avoid this warning}}{{18-18=!}}
64
64
// expected-note@-3 {{explicitly cast to 'Any' with 'as Any' to silence this warning}}{{18-18= as Any}}
65
-
// expected-warning@-4 {{expression implicitly coerced from 'D?' to 'Any'}}
65
+
// expected-warning@-4 {{coercion of implicitly unwrappable value of type 'D?' to 'Any' does not unwrap optional}}
66
66
// expected-note@-5 {{provide a default value to avoid this warning}}{{23-23= ?? <#default value#>}}
67
67
// expected-note@-6 {{force-unwrap the value to avoid this warning}}{{23-23=!}}
68
68
// expected-note@-7 {{explicitly cast to 'Any' with 'as Any' to silence this warning}}{{23-23= as Any}}
takesCollectionOfAny([a],["test": a]) // expected-warning {{coercion of implicitly unwrappable value of type 'Int?' to 'Any' does not unwrap optional}}
98
98
// expected-note@-1 {{provide a default value to avoid this warning}}{{26-26= ?? <#default value#>}}
99
99
// expected-note@-2 {{force-unwrap the value to avoid this warning}}{{26-26=!}}
100
100
// expected-note@-3 {{explicitly cast to 'Any' with 'as Any' to silence this warning}}{{26-26= as Any}}
101
-
// expected-warning@-4 {{expression implicitly coerced from 'Int?' to 'Any'}}
101
+
// expected-warning@-4 {{coercion of implicitly unwrappable value of type 'Int?' to 'Any' does not unwrap optional}}
102
102
// expected-note@-5 {{provide a default value to avoid this warning}}{{40-40= ?? <#default value#>}}
103
103
// expected-note@-6 {{force-unwrap the value to avoid this warning}}{{40-40=!}}
104
104
// expected-note@-7 {{explicitly cast to 'Any' with 'as Any' to silence this warning}}{{40-40= as Any}}
105
105
}
106
+
107
+
func takesAny_sr10199(_ x:Any){}
108
+
109
+
letfn_sr10199:(()->Int?)!={returnnil}
110
+
takesAny_sr10199(fn_sr10199()) // expected-warning {{expression implicitly coerced from 'Int?' to 'Any'}}
111
+
// expected-note@-1 {{provide a default value to avoid this warning}}
112
+
// expected-note@-2 {{force-unwrap the value to avoid this warning}}
113
+
// expected-note@-3 {{explicitly cast to 'Any' with 'as Any' to silence this warning}}
0 commit comments