File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: %target-typecheck-verify-swift
2
+ // RUN: %target-swift-frontend -typecheck %s -debug-generic-signatures 2>&1 | %FileCheck %s
3
+
4
+ public struct G < T: P1 , U: P1 > {
5
+ // CHECK-LABEL: .f1()@
6
+ // CHECK-NEXT: Generic signature: <T, U where T : P1, T == U>
7
+ public func f1( ) where T == U { }
8
+
9
+ // CHECK-LABEL: .f2()@
10
+ // CHECK-NEXT: Generic signature: <T, U where T : P1, T == U>
11
+ public func f2( ) where T == U , T. A. B == T { }
12
+ // expected-warning@-1 {{redundant same-type constraint 'T.A.B' == 'T'}}
13
+
14
+ // CHECK-LABEL: .f3()@
15
+ // CHECK-NEXT: Generic signature: <T, U where T : P1, T == U>
16
+ public func f3( ) where T. A. B == T , T == U { }
17
+ // expected-warning@-1 {{redundant same-type constraint 'T.A.B' == 'T'}}
18
+
19
+ // CHECK-LABEL: .f4()@
20
+ // CHECK-NEXT: Generic signature: <T, U where T : P1, T == U>
21
+ public func f4( ) where U. A. B == U , T == U { }
22
+ // expected-warning@-1 {{redundant same-type constraint 'U.A.B' == 'U'}}
23
+ }
24
+
25
+ public protocol P1 {
26
+ associatedtype A : P2 where A. B == Self
27
+ }
28
+
29
+ public protocol P2 {
30
+ associatedtype B : P1
31
+ }
You can’t perform that action at this time.
0 commit comments