Skip to content

Commit 228f7f4

Browse files
committed
[RequirementMachine] Add tests for shape requirements made redundant by
same-type requirements.
1 parent 60f8000 commit 228f7f4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/Generics/pack-shape-requirements.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,19 @@ func multipleSameShape5<@_typeSequence T, @_typeSequence U, @_typeSequence V>(ts
4343
// CHECK-NEXT: Generic signature: <@_typeSequence T, @_typeSequence U, @_typeSequence V where T.count == U.count, U.count == V.count>
4444
func multipleSameShape6<@_typeSequence T, @_typeSequence U, @_typeSequence V>(ts t: T..., us u: U..., vs v: V...) where ((V, U, T)...): Any {
4545
}
46+
47+
struct Ts<@_typeSequence T> {
48+
struct Us<@_typeSequence U> {
49+
// CHECK-LABEL: Ts.Us.packEquality()
50+
// CHECK-NEXT: Generic signature: <@_typeSequence T, @_typeSequence U where T == U>
51+
func packEquality() where T == U, ((T, U)...): Any {
52+
}
53+
54+
struct Vs<@_typeSequence V> {
55+
// CHECK-LABEL: Ts.Us.Vs.packEquality()
56+
// CHECK-NEXT: Generic signature: <@_typeSequence T, @_typeSequence U, @_typeSequence V where T == U, T.count == V.count>
57+
func packEquality() where T == U, ((U, V)...): Any {
58+
}
59+
}
60+
}
61+
}

0 commit comments

Comments
 (0)