Skip to content

Commit 43c3004

Browse files
committed
[NFC] Update additional parameter pack tests.
1 parent 79c4cfb commit 43c3004

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

test/Generics/pack-shape-requirements.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ func inferSameShape<each T, each U>(ts t: repeat each T, us u: repeat each U) wh
1212
// CHECK-LABEL: desugarSameShape(ts:us:)
1313
// CHECK-NEXT: Generic signature: <each T, each U where repeat each T : P, (repeat (each T, each U)) : Any, repeat each U : P>
1414
func desugarSameShape<each T, each U>(ts t: repeat each T, us u: repeat each U)
15-
where repeat each T: P, repeat each U: P, (repeat (each T.A, each U.A)): Any {}
15+
where repeat each T: P, repeat each U: P, (repeat ((each T).A, (each U).A)): Any {}
1616

1717
// CHECK-LABEL: multipleSameShape1(ts:us:vs:)
1818
// CHECK-NEXT: Generic signature: <each T, each U, each V where (repeat (each T, each U)) : Any, (repeat (each U, each V)) : Any>
@@ -75,11 +75,11 @@ func expandedParameters<each T, each Result>(_ t: repeat each T, transform: repe
7575

7676
// CHECK-LABEL: sameType1
7777
// CHECK-NEXT: Generic signature: <each T, each U where repeat each T : P, repeat each U : P, repeat (each T).[P]A == (each U).[P]A>
78-
func sameType1<each T, each U>(_: repeat (each T, each U)) where repeat each T: P, repeat each U: P, repeat each T.A == each U.A {}
78+
func sameType1<each T, each U>(_: repeat (each T, each U)) where repeat each T: P, repeat each U: P, repeat (each T).A == (each U).A {}
7979

8080
// Make sure inherited associated types are handled
8181
protocol Q: P where A: Q {}
8282

8383
// CHECK-LABEL: sameType2
8484
// CHECK-NEXT: Generic signature: <each T, each U where repeat each T : Q, repeat each U : Q, repeat (each T).[P]A.[P]A == (each U).[P]A.[P]A>
85-
func sameType2<each T, each U>(_: repeat (each T, each U)) where repeat each T: Q, repeat each U: Q, repeat each T.A.A == each U.A.A {}
85+
func sameType2<each T, each U>(_: repeat (each T, each U)) where repeat each T: Q, repeat each U: Q, repeat (each T).A.A == (each U).A.A {}

test/Generics/tuple-conformances.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ protocol P {
1212
}
1313

1414
extension Builtin.TheTupleType: P where repeat each Elements: P {
15-
typealias A = (repeat each Elements.A)
15+
typealias A = (repeat (each Elements).A)
1616
typealias B = Float
1717
func f() {}
1818
}

test/Generics/variadic_generic_requirements.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ _ = Layout<Class, Subclass>.self // ok
2020
_ = Layout<Int, String>.self // expected-error {{'Layout' requires that 'Int' be a class type}}
2121

2222
struct Outer<each T: Sequence> {
23-
struct Inner<each U: Sequence> where repeat each T.Element == each U.Element {}
23+
struct Inner<each U: Sequence> where repeat (each T).Element == (each U).Element {}
2424
// expected-note@-1 {{requirement specified as '(each T).Element' == '(each U).Element' [with each T = Array<Int>, Array<String>; each U = Set<String>, Set<Int>]}}
2525
// expected-note@-2 {{requirement specified as '(each T).Element' == '(each U).Element' [with each T = Array<Int>; each U = Set<Int>, Set<String>]}}
2626

test/type/pack_expansion.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct Outer<each T> {
6464

6565
func packRef<each T>(_: repeat each T) where repeat each T: P {}
6666

67-
func packMemberRef<each T>(_: repeat each T.T) where repeat each T: P {}
67+
func packMemberRef<each T>(_: repeat (each T).T) where repeat each T: P {}
6868

6969
// expected-error@+1 {{'each' cannot be applied to non-pack type 'Int'}}{{31-35=}}
7070
func invalidPackRefEachInt(_: each Int) {}

validation-test/compiler_crashers_2_fixed/rdar108319167.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ public func foo1<each T: Q, each U>(t: repeat each T, u: repeat each U)
1313
repeat f(each u)
1414
}
1515

16-
public func foo2<each T: Q>(t: repeat each T, u: repeat each T.A) {
16+
public func foo2<each T: Q>(t: repeat each T, u: repeat (each T).A) {
1717
repeat f(each u)
1818
}

validation-test/compiler_crashers_2_fixed/rdar110363503.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ struct ZipCollection<each C: Collection> {
66

77
extension ZipCollection: Collection {
88
struct Element {
9-
var elt: (repeat each C.Element)
9+
var elt: (repeat (each C).Element)
1010
}
1111

1212
struct Index {
13-
let i: (repeat each C.Index)
13+
let i: (repeat (each C).Index)
1414
}
1515

1616
var startIndex: Index {

validation-test/compiler_crashers_2_fixed/rdar112108253.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public protocol Q {
1010
init()
1111
}
1212

13-
public struct S<T: P, each U: P>: Q where repeat T.A == G<repeat each U.A> {
13+
public struct S<T: P, each U: P>: Q where repeat T.A == G<repeat (each U).A> {
1414
public init() {}
1515
public init(predicate: repeat each U) {}
1616
}

0 commit comments

Comments
 (0)