Skip to content

Commit c60e517

Browse files
committed
[Diagnostics] NFC: Add another test-case improve my tracking missing conformances
1 parent c2bf3d5 commit c60e517

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/Constraints/generics.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,4 +611,13 @@ func rdar40537858() {
611611

612612
var arr: [S] = []
613613
_ = List(arr, id: \.id) // expected-error {{'List<[S], S.Id>' requires that 'S.Id' conform to 'Hashable'}}
614+
615+
enum E<T: P> {
616+
case foo(T)
617+
case bar([T])
618+
}
619+
620+
var s = S(id: S.Id())
621+
let _: E = .foo(s) // expected-error {{'E<S>' requires that 'S' conform to 'P'}}
622+
let _: E = .bar([s]) // expected-error {{'E<S>' requires that 'S' conform to 'P'}}
614623
}

0 commit comments

Comments
 (0)