Skip to content

Commit bc4a346

Browse files
committed
Gardening: Migrate test suite to GH issues: Generics
1 parent 81f8fd6 commit bc4a346

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+122
-43
lines changed

test/Generics/associated_types.swift

+12-10
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,9 @@ struct V<T> : Fooable {
152152
var w = W.AssocType()
153153
var v = V<String>.AssocType()
154154

155-
//
156-
// SR-427
155+
156+
// https://github.com/apple/swift/issues/43044
157+
157158
protocol A {
158159
func c()
159160
}
@@ -176,8 +177,8 @@ struct CC : B {
176177

177178
C<CC>().c()
178179

179-
// SR-511
180-
protocol sr511 {
180+
// https://github.com/apple/swift/issues/43128
181+
protocol P_43128 {
181182
typealias Foo // expected-error {{type alias is missing an assigned type; use 'associatedtype' to define an associated type requirement}}
182183
}
183184

@@ -200,27 +201,28 @@ extension M {
200201
}
201202
}
202203

203-
// SR-6097
204-
protocol sr6097 {
204+
// https://github.com/apple/swift/issues/48652
205+
206+
protocol P11a {
205207
associatedtype A : AnyObject
206208
var aProperty: A { get }
207209
}
208210

209211
class C1 {}
210-
class C2 : sr6097 {
212+
class C2 : P11a {
211213
unowned let aProperty: C1 // should deduce A == C1 despite 'unowned'
212214
init() { fatalError() }
213215
}
214216

215-
protocol sr6097_b {
217+
protocol P11b {
216218
associatedtype A : AnyObject
217219
var aProperty: A? { get }
218220
}
219-
class C3 : sr6097_b {
221+
class C3 : P11b {
220222
weak var aProperty: C1? // and same here, despite 'weak'
221223
init() { fatalError() }
222224
}
223-
class G<T> : sr6097_b where T : AnyObject {
225+
class G<T> : P11b where T : AnyObject {
224226
weak var aProperty: T?
225227
}
226228

test/Generics/associated_types_inherit.swift

+4-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ func callTestP(_ x1: X1) {
3131
testP(x1)
3232
}
3333

34-
// SR-10251: unable to infer associated type in child protocol
34+
// https://github.com/apple/swift/issues/52651
35+
// Unable to infer associated type in child protocol
36+
// FIXME: We already have a test case for this in test/decl/protocol/req/associated_type_inference_fixed_type.swift
37+
3538
protocol P2 { associatedtype T }
3639

3740
protocol P3: P2 where T == Self {}

test/Generics/class_constraint.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ struct Z<U> {
2525
let bad3: X<U> // expected-error{{'X' requires that 'U' be a class type}}
2626
}
2727

28-
// SR-7168: layout constraints weren't getting merged.
28+
// https://github.com/apple/swift/issues/49716
29+
// Layout constraints weren't getting merged.
30+
2931
protocol P1 {
3032
associatedtype A
3133
var a: A { get }

test/Generics/conditional_conformances.swift

+13-12
Original file line numberDiff line numberDiff line change
@@ -378,15 +378,15 @@ func passesConditionallyNotF7(x21: X2<X1>) {
378378
takesF7(x21) // expected-error{{global function 'takesF7' requires that 'X1.A' (aka 'X0') conform to 'P7'}}
379379
}
380380

381-
382-
public struct SR6990<T, U> {}
383-
extension SR6990: Sequence where T == Int {
381+
// https://github.com/apple/swift/issues/49538
382+
public struct S_49538<T, U> {}
383+
extension S_49538: Sequence where T == Int {
384384
public typealias Element = Float
385385
public typealias Iterator = IndexingIterator<[Float]>
386386
public func makeIterator() -> Iterator { fatalError() }
387387
}
388388

389-
// SR-8324
389+
// https://github.com/apple/swift/issues/50852
390390
protocol ElementProtocol {
391391
associatedtype BaseElement: BaseElementProtocol = Self
392392
}
@@ -403,7 +403,8 @@ extension Array: NestedArrayProtocol where Element: ElementProtocol, Element: Ar
403403
// typealias BaseElement = Element.BaseElement
404404
}
405405

406-
// SR-8337
406+
// https://github.com/apple/swift/issues/50865
407+
407408
struct Foo<Bar> {}
408409

409410
protocol P {
@@ -426,13 +427,13 @@ extension BinaryInteger {
426427
}
427428
}
428429

429-
// SR-10992
430+
// https://github.com/apple/swift/issues/53382
430431

431-
protocol SR_10992_P {}
432-
struct SR_10992_S<T> {}
433-
extension SR_10992_S: SR_10992_P where T: SR_10992_P {} // expected-note {{requirement from conditional conformance of 'SR_10992_S<String>' to 'SR_10992_P'}}
432+
protocol P_53382 {}
433+
struct S_53382<T> {}
434+
extension S_53382: P_53382 where T: P_53382 {} // expected-note {{requirement from conditional conformance of 'S_53382<String>' to 'P_53382'}}
434435

435-
func sr_10992_foo(_ fn: (SR_10992_S<String>) -> Void) {}
436-
func sr_10992_bar(_ fn: (SR_10992_P) -> Void) {
437-
sr_10992_foo(fn) // expected-error {{global function 'sr_10992_foo' requires that 'String' conform to 'SR_10992_P'}}
436+
func f1_53382(_ fn: (S_53382<String>) -> Void) {}
437+
func f2_53382(_ fn: (P_53382) -> Void) {
438+
f1_53382(fn) // expected-error {{global function 'f1_53382' requires that 'String' conform to 'P_53382'}}
438439
}

test/Generics/conditional_conformances_literals.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// RUN: %target-typecheck-verify-swift
22

3-
// rdar://problem/38461036 , https://bugs.swift.org/browse/SR-7192 and highlights the real problem in https://bugs.swift.org/browse/SR-6941
3+
// rdar://problem/38461036
4+
// https://github.com/apple/swift/issues/49740 and highlights the real problem
5+
// in https://github.com/apple/swift/issues/49489
46

57
protocol SameType {}
68
protocol Conforms {}

test/Generics/deduction.swift

+4-3
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,10 @@ class DeducePropertyParams {
309309
let badSet: Set = ["Hello"]
310310
}
311311

312-
// SR-69
313-
struct A {}
314-
func foo() {
312+
// https://github.com/apple/swift/issues/42691
313+
do {
314+
struct A {}
315+
315316
for i in min(1,2) { // expected-error{{for-in loop requires 'Int' to conform to 'Sequence'}}
316317
}
317318
let j = min(Int(3), Float(2.5)) // expected-error{{conflicting arguments to generic parameter 'T' ('Int' vs. 'Float')}}

test/Generics/generic-nested-in-extension-on-objc-class.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99

1010
import Foundation
1111

12+
// https://github.com/apple/swift/issues/53775
13+
//
1214
// Test the fix for a crash when instantiating the metadata for a generic type
1315
// nested in an extension on an ObjC class in a different file.
14-
// https://bugs.swift.org/browse/SR-11374
1516

1617
extension NSString {
1718
class _Inner2<T> where T: NSObject {}

test/Generics/invalid.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ class P<N> {
105105
// expected-error@-1 {{type 'N' constrained to non-protocol, non-class type 'A.XYZ'}}
106106
}
107107

108-
// SR-5579
108+
// https://github.com/apple/swift/issues/48151
109+
109110
protocol Foo {
110111
associatedtype Bar where Bar.Nonsense == Int // expected-error{{'Nonsense' is not a member type of type 'Self.Bar'}}
111112
}

test/Generics/non_generic_derived_class.swift

+6-4
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ class Derived : Base<Int> {}
1010

1111
var a = Derived.f(42)
1212

13-
protocol SR9160_EmptyProtocol {}
14-
class SR9160_AbstractFoobar<Foo> {}
13+
// https://github.com/apple/swift/issues/51655
14+
15+
protocol EmptyProtocol {}
16+
class AbstractFoobar<Foo> {}
1517
// This used to cause the swift compiler to never finish compiling.
16-
final class SR9160_SomeFoobar: SR9160_AbstractFoobar<SR9160_SomeFoobar.Foo> {
17-
enum Foo: SR9160_EmptyProtocol {}
18+
final class SomeFoobar: AbstractFoobar<SomeFoobar.Foo> {
19+
enum Foo: EmptyProtocol {}
1820
}

test/Generics/protocol_requirement_signatures.swift

+4-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ protocol Q7: Q2, Q3, Q4 {
6161
associatedtype X: P3 // expected-warning{{redeclaration of associated type 'X'}}
6262
}
6363

64-
// SR-5945
64+
// https://github.com/apple/swift/issues/48504
65+
6566
class SomeBaseClass {}
6667

6768
// CHECK-DAG: .P4@
@@ -77,7 +78,8 @@ protocol P5 {
7778
associatedtype AType : P4 where AType.BType == Self
7879
}
7980

80-
// SR-8119
81+
// https://github.com/apple/swift/issues/50651
82+
8183
protocol P6 {
8284
associatedtype A1: P7
8385
}

test/Generics/protocol_where_clause.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ struct BadConcreteNestedConforms: NestedConforms {
7272
}
7373

7474

75-
// SR4693:
75+
// https://github.com/apple/swift/issues/47270
76+
7677
protocol P1 {}
7778
struct X: P1 {}
7879
struct Y<T: P1> {}

test/Generics/sr10438.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// RUN: %target-typecheck-verify-swift -debug-generic-signatures 2>&1 | %FileCheck %s
22

3+
// https://github.com/apple/swift/issues/52838
4+
35
// CHECK: sr10438.(file).AuthenticationFlowStateMachine@
46
// CHECK-NEXT: Requirement signature: <Self where Self == Self.[AuthenticationFlowStateMachine]FlowError.[AuthenticationFlowStateMachineFlowError]StateMachine, Self.[AuthenticationFlowStateMachine]FlowError : AuthenticationFlowStateMachineFlowError, Self.[AuthenticationFlowStateMachine]NonFinalState : AuthenticationFlowStateMachineNonFinalState, Self.[AuthenticationFlowStateMachine]StartState : AuthenticationFlowStateMachineStartState, Self.[AuthenticationFlowStateMachine]FlowError.[AuthenticationFlowStateMachineFlowError]StateMachine == Self.[AuthenticationFlowStateMachine]NonFinalState.[AuthenticationFlowStateMachineNonFinalState]StateMachine, Self.[AuthenticationFlowStateMachine]NonFinalState.[AuthenticationFlowStateMachineNonFinalState]StateMachine == Self.[AuthenticationFlowStateMachine]StartState.[AuthenticationFlowStateMachineStartState]StateMachine>
57
protocol AuthenticationFlowStateMachine {

test/Generics/sr10532.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// RUN: %target-typecheck-verify-swift -debug-generic-signatures 2>&1 | %FileCheck %s
22

3+
// https://github.com/apple/swift/issues/52932
4+
35
// CHECK: sr10532.(file).ScalarProtocol@
46
// CHECK-NEXT: Requirement signature: <Self where Self : ScalarMultiplicative, Self == Self.[ScalarMultiplicative]Scalar>
57
public protocol ScalarProtocol: ScalarMultiplicative where Self == Scalar { }

test/Generics/sr10752.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// RUN: %target-typecheck-verify-swift -debug-generic-signatures -warn-redundant-requirements 2>&1 | %FileCheck %s
22

3+
// https://github.com/apple/swift/issues/53142
4+
35
// CHECK: sr10752.(file).P@
46
// CHECK-NEXT: Requirement signature: <Self where Self.[P]A : P, Self.[P]A == Self.[P]A.[P]A>
57
protocol P {

test/Generics/sr11100.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// RUN: %target-typecheck-verify-swift -debug-generic-signatures 2>&1 | %FileCheck %s
22

3+
// https://github.com/apple/swift/issues/53495
4+
35
protocol P1 {
46
associatedtype A
57
}

test/Generics/sr11153.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// RUN: %target-swift-frontend -typecheck -debug-generic-signatures %s 2>&1 | %FileCheck %s
22
// RUN: %target-swift-frontend -emit-ir %s
33

4+
// https://github.com/apple/swift/issues/53550
5+
46
// CHECK: Requirement signature: <Self where Self.[VectorSpace]Field : FieldAlgebra>
57
public protocol VectorSpace {
68
associatedtype Field: FieldAlgebra

test/Generics/sr11997.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// RUN: %target-typecheck-verify-swift -debug-generic-signatures 2>&1 | %FileCheck %s
22

3+
// https://github.com/apple/swift/issues/54431
4+
35
// CHECK: sr11997.(file).A@
46
// CHECK-NEXT: Requirement signature: <Self where Self == Self.[A]X.[B]Y, Self.[A]X : B>
57
protocol A {

test/Generics/sr12120.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// RUN: %target-typecheck-verify-swift -debug-generic-signatures -warn-redundant-requirements 2>&1 | %FileCheck %s
22

3+
// https://github.com/apple/swift/issues/54555
4+
35
// CHECK: sr12120.(file).Swappable1@
46
// CHECK-NEXT: Requirement signature: <Self where Self == Self.[Swappable1]Swapped.[Swappable1]Swapped, Self.[Swappable1]B == Self.[Swappable1]Swapped.[Swappable1]A, Self.[Swappable1]Swapped : Swappable1>
57
protocol Swappable1 {

test/Generics/sr12531.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// RUN: %target-typecheck-verify-swift
22

3+
// https://github.com/apple/swift/issues/54974
4+
35
protocol AnyPropertyProtocol {
46
associatedtype Root = Any
57
associatedtype Value = Any

test/Generics/sr12736.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// RUN: %target-typecheck-verify-swift -debug-generic-signatures 2>&1 | %FileCheck %s
22

3+
// https://github.com/apple/swift/issues/55182
4+
35
// CHECK: sr12736.(file).ColorModel@
46
// CHECK-NEXT: Requirement signature: <Self where Self == Self.[ColorModel]Float32Components.[ColorComponents]Model, Self.[ColorModel]Float32Components : ColorComponents>
57
public protocol ColorModel {

test/Generics/sr12812.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// RUN: %target-typecheck-verify-swift
22
// RUN: %target-swift-frontend -debug-generic-signatures -emit-ir %s 2>&1 | %FileCheck %s
33

4+
// https://github.com/apple/swift/issues/55258
5+
46
public protocol DefaultInitializable {
57
init()
68
}
@@ -80,7 +82,7 @@ public extension GeneralAdjacencyList
8082
where VertexIDToIndex == IdentityVertexIDToIndex<Spine>,
8183
Spine: RangeReplaceableCollection,
8284
Spine.Element.Edges: RangeReplaceableCollection
83-
& BidirectionalCollection // Because https://bugs.swift.org/browse/SR-12810
85+
& BidirectionalCollection // Because https://github.com/apple/swift/issues/55257
8486
{
8587
func addVertex(storing properties: VertexProperties) -> VertexID {
8688
return spine.indices.first!

test/Generics/sr12980.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// RUN: %target-swift-frontend -typecheck %s -debug-generic-signatures 2>&1 | %FileCheck %s
22

3+
// https://github.com/apple/swift/issues/55426
4+
35
protocol VectorIndex : CaseIterable {}
46

57
protocol Vector {

test/Generics/sr13226.swift

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
// RUN: %target-typecheck-verify-swift
2+
3+
// https://github.com/apple/swift/issues/55666
4+
25
struct W<T> {}
36

47
struct S<C1: Collection> {

test/Generics/sr13850.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %target-typecheck-verify-swift -debug-generic-signatures 2>&1 | %FileCheck %s
22

3-
// https://bugs.swift.org/browse/SR-13850
3+
// https://github.com/apple/swift/issues/56248
44

55
// CHECK: Requirement signature: <Self where Self.[P1]A : P2>
66
protocol P1 {

test/Generics/sr14289.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// RUN: %target-swift-frontend -emit-ir %s
22

3+
// https://github.com/apple/swift/issues/56648
4+
35
public protocol One {
46
associatedtype MyType
57
}

test/Generics/sr14485.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// RUN: %target-typecheck-verify-swift -debug-generic-signatures -warn-redundant-requirements 2>&1 | %FileCheck %s
22

3+
// https://github.com/apple/swift/issues/56840
4+
35
// CHECK: sr14485.(file).P@
46
// CHECK-NEXT: Requirement signature: <Self where Self.[P]Input == Self.[P]Output.[Numeric]Magnitude, Self.[P]Output : FixedWidthInteger, Self.[P]Output : SignedInteger>
57
protocol P {

test/Generics/sr14510.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// RUN: %target-typecheck-verify-swift -warn-redundant-requirements
22
// RUN: %target-swift-frontend -debug-generic-signatures -typecheck %s 2>&1 | %FileCheck %s
33

4+
// https://github.com/apple/swift/issues/56862
5+
46
// CHECK-LABEL: Requirement signature: <Self where Self == Self.[Adjoint]Dual.[Adjoint]Dual, Self.[Adjoint]Dual : Adjoint>
57
public protocol Adjoint {
68
associatedtype Dual: Adjoint where Self.Dual.Dual == Self

test/Generics/sr14580.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// RUN: %target-typecheck-verify-swift
22
// RUN: %target-swift-frontend -typecheck -debug-generic-signatures %s 2>&1 | %FileCheck %s
33

4+
// https://github.com/apple/swift/issues/56932
5+
46
public protocol ScalarProtocol: ScalarMultiplicative where Self == Scalar {
57
}
68

test/Generics/sr14917.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// RUN: %target-typecheck-verify-swift -warn-redundant-requirements
22

3+
// https://github.com/apple/swift/issues/57264
4+
35
protocol P {
46
associatedtype A
57
associatedtype AS: Q where AS.B == A

test/Generics/sr15009.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// RUN: %target-typecheck-verify-swift -debug-generic-signatures 2>&1 | %FileCheck %s
22

3+
// https://github.com/apple/swift/issues/57339
4+
35
// CHECK: sr15009.(file).P@
46
// CHECK-NEXT: Requirement signature: <Self where Self == Self.[P]A.[Q]B, Self.[P]A : Q>
57
protocol P { associatedtype A: Q where A.B == Self }

test/Generics/sr15790.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// RUN: %target-swift-frontend -typecheck %s -debug-generic-signatures 2>&1 | %FileCheck %s
22

3+
// https://github.com/apple/swift/issues/58067
4+
35
// CHECK-LABEL: sr15790.(file).P1@
46
// CHECK-NEXT: Requirement signature: <Self where Self.[P1]X : P1, Self.[P1]X == Self.[P1]X.[P1]X>
57
public protocol P1 {

0 commit comments

Comments
 (0)