1+ // RUN: %target-typecheck-verify-swift
12// RUN: %target-swift-frontend -typecheck %s -debug-generic-signatures 2>&1 | %FileCheck %s
23
3- // rdar://problem/88135912
4- // XFAIL: *
5-
64protocol P {
75 associatedtype T
86}
@@ -15,6 +13,7 @@ struct S : P {
1513
1614protocol R0 {
1715 associatedtype A where A : P , A == S
16+ // expected-warning@-1 {{redundant conformance constraint 'S' : 'P'}}
1817}
1918
2019////
@@ -27,13 +26,15 @@ struct G<T> : P {}
2726protocol R1 {
2827 associatedtype A
2928 associatedtype B where B : P , B == G < A >
29+ // expected-warning@-1 {{redundant conformance constraint 'G<Self.A>' : 'P'}}
3030}
3131
3232// CHECK-LABEL: concrete_conformances_in_protocol.(file).R2@
3333// CHECK-LABEL: Requirement signature: <Self where Self.[R2]A == G<Self.[R2]B>>
3434
3535protocol R2 {
3636 associatedtype A where A : P , A == G < B >
37+ // expected-warning@-1 {{redundant conformance constraint 'G<Self.B>' : 'P'}}
3738 associatedtype B
3839}
3940
@@ -51,13 +52,15 @@ struct GG<T : P> : PP {}
5152protocol RR3 {
5253 associatedtype A : P
5354 associatedtype B where B : PP , B == GG < A >
55+ // expected-warning@-1 {{redundant conformance constraint 'GG<Self.A>' : 'PP'}}
5456}
5557
5658// CHECK-LABEL: concrete_conformances_in_protocol.(file).RR4@
5759// CHECK-LABEL: Requirement signature: <Self where Self.[RR4]A == GG<Self.[RR4]B>, Self.[RR4]B : P>
5860
5961protocol RR4 {
6062 associatedtype A where A : PP , A == GG < B >
63+ // expected-warning@-1 {{redundant conformance constraint 'GG<Self.B>' : 'PP'}}
6164 associatedtype B : P
6265}
6366
@@ -67,12 +70,32 @@ protocol RR4 {
6770protocol RR5 {
6871 associatedtype A : PP
6972 associatedtype B where B : PP , B == GG < A . T >
73+ // expected-warning@-1 {{redundant conformance constraint 'GG<Self.A.T>' : 'PP'}}
7074}
7175
7276// CHECK-LABEL: concrete_conformances_in_protocol.(file).RR6@
7377// CHECK-LABEL: Requirement signature: <Self where Self.[RR6]A == GG<Self.[RR6]B.[PP]T>, Self.[RR6]B : PP>
7478
7579protocol RR6 {
7680 associatedtype A where A : PP , A == GG < B . T >
81+ // expected-warning@-1 {{redundant conformance constraint 'GG<Self.B.T>' : 'PP'}}
7782 associatedtype B : PP
7883}
84+
85+ protocol P1 {
86+ associatedtype T : P1
87+ }
88+
89+ struct GGG < U : P1 > : P1 {
90+ typealias T = GGG < GGG < U > >
91+ }
92+
93+ // CHECK-LABEL: concrete_conformances_in_protocol.(file).P2@
94+ // CHECK-LABEL: Requirement signature: <Self where Self.[P2]T == GGG<Self.[P2]U>, Self.[P2]U : P1>
95+
96+ protocol P2 {
97+ associatedtype T : P1 where T == GGG < U >
98+ // expected-warning@-1 {{redundant conformance constraint 'GGG<Self.U>' : 'P1'}}
99+ associatedtype U : P1
100+ }
101+
0 commit comments