File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -401,3 +401,20 @@ func rdar_50099849() {
401
401
let _ = C < A , B > ( ) // expected-error {{generic parameter 'C' could not be inferred}}
402
402
// expected-note@-1 {{explicitly specify the generic arguments to fix this issue}} {{17-17=<<#C: Trivial#>>}}
403
403
}
404
+
405
+ // rdar://problem/50512161 - improve diagnostic when generic parameter cannot be deduced
406
+ func rdar_50512161( ) {
407
+ struct Item { }
408
+
409
+ struct TrivialItem : Trivial {
410
+ typealias T = Item ?
411
+ }
412
+
413
+ func foo< I> ( _: I . Type = I . self, item: I . T ) where I : Trivial { // expected-note {{in call to function 'foo(_:item:)'}}
414
+ fatalError ( )
415
+ }
416
+
417
+ func bar( _ item: Item ) {
418
+ foo ( item: item) // expected-error {{generic parameter 'I' could not be inferred}}
419
+ }
420
+ }
You can’t perform that action at this time.
0 commit comments