File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -288,6 +288,20 @@ struct S<T> {
288
288
}
289
289
}
290
290
291
+ // Similar to SR1069 but with multiple generic arguments
292
+ func simplified1069( ) {
293
+ class C { }
294
+ struct S {
295
+ func genericallyNonOptional< T: AnyObject > ( _ a: T , _ b: T , _ c: T ) { }
296
+
297
+ func f( _ a: C ? , _ b: C ? , _ c: C ) {
298
+ genericallyNonOptional ( a, b, c) // expected-error 2{{value of optional type 'C?' must be unwrapped to a value of type 'C'}}
299
+ // expected-note @-1 2{{coalesce}}
300
+ // expected-note @-2 2{{force-unwrap}}
301
+ }
302
+ }
303
+ }
304
+
291
305
// Make sure we cannot infer an () argument from an empty parameter list.
292
306
func acceptNothingToInt ( _: ( ) -> Int ) { }
293
307
func testAcceptNothingToInt( ac1: @autoclosure ( ) -> Int ) {
You can’t perform that action at this time.
0 commit comments