@@ -160,7 +160,9 @@ struct S1116 {
160
160
}
161
161
162
162
let a1116 : [ S1116 ] = [ ]
163
- var s1116 = Set ( 1 ... 10 ) . subtracting ( a1116. map ( { $0. s } ) ) // expected-error {{cannot convert value of type '[Int?]' to expected argument type 'Set<Int>'}}
163
+ var s1116 = Set ( 1 ... 10 ) . subtracting ( a1116. map ( { $0. s } ) ) // expected-error {{value of optional type 'Int?' must be unwrapped to a value of type 'Int'}}
164
+ // expected-note@-1{{force-unwrap}}
165
+ // expected-note@-2{{coalesce}}
164
166
165
167
166
168
func moreComplexUnwrapFixes( ) {
@@ -202,22 +204,16 @@ func moreComplexUnwrapFixes() {
202
204
// expected-note@-4{{force-unwrap using '!'}}{{17-17=!}}
203
205
204
206
takeNon ( os? . value) // expected-error{{value of optional type 'Int?' must be unwrapped to a value of type 'Int'}}
205
- // expected-note@-1{{force-unwrap using '!'}}{{13-14 =!}}
207
+ // expected-note@-1{{force-unwrap using '!'}}{{21-21 =!}}
206
208
// expected-note@-2{{coalesce}}
207
209
takeNon ( os? . optValue) // expected-error{{value of optional type 'Int?' must be unwrapped to a value of type 'Int'}}
208
- // expected-note@-1{{force-unwrap using '!'}}{{11-11=(}}{{23-23=) !}}
210
+ // expected-note@-1{{force-unwrap using '!'}}{{24-24= !}}
209
211
// expected-note@-2{{coalesce}}
210
212
211
213
func sample( a: Int ? , b: Int ! ) {
212
214
let aa = a
213
- // expected-note@-1{{short-circuit using 'guard'}}{{5-5=guard }} {{15-15= else \{ return \}}}
214
- // expected-note@-2{{force-unwrap}}
215
- // expected-note@-3{{coalesce}}
216
215
217
- let bb = b // expected-note{{value inferred to be type 'Int?' when initialized with an implicitly unwrapped value}}
218
- // expected-note@-1{{short-circuit using 'guard'}}{{5-5=guard }} {{15-15= else \{ return \}}}
219
- // expected-note@-2{{force-unwrap}}
220
- // expected-note@-3{{coalesce}}
216
+ let bb = b
221
217
222
218
let cc = a
223
219
0 commit comments