File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -333,3 +333,15 @@ func sr_9893_2(cString: UnsafePointer<CChar>) {
333
333
}
334
334
}
335
335
}
336
+
337
+ // rdar://problem/47776586 - Diagnostic refers to '&' which is not present in the source code
338
+ func rdar47776586( ) {
339
+ func foo( _: inout Int ) { }
340
+ var x : Int ? = 0
341
+ foo ( & x) // expected-error {{value of optional type 'Int?' must be unwrapped to a value of type 'Int'}}
342
+ // expected-note@-1 {{force-unwrap using '!' to abort execution if the optional value contains 'nil'}} {{7-7=(}} {{9-9=)!}}
343
+
344
+ var dict = [ 1 : 2 ]
345
+ dict [ 1 ] += 1 // expected-error {{value of optional type 'Int?' must be unwrapped to a value of type 'Int'}}
346
+ // expected-note@-1 {{force-unwrap using '!' to abort execution if the optional value contains 'nil'}} {{10-10=!}}
347
+ }
You can’t perform that action at this time.
0 commit comments