Skip to content

Commit 1b79e2e

Browse files
Merge pull request #60791 from AnthonyLatsis/migrate-test-suite-to-gh-issues-11
Gardening: Migrate test suite to GH issues p. 11
2 parents 73f2a25 + 4ee63da commit 1b79e2e

20 files changed

+174
-150
lines changed

test/decl/protocol/conforms/associated_type.swift

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ struct X : P { // expected-error{{type 'X' does not conform to protocol 'P'}}
1212
typealias AssocA = Int // expected-note{{possibly intended match 'X.AssocA' (aka 'Int') does not conform to 'AnyObject'}}
1313
}
1414

15-
// SR-5166
15+
// https://github.com/apple/swift/issues/47742
1616
protocol FooType {
1717
associatedtype BarType
1818

@@ -113,60 +113,60 @@ struct X2d : P2 { // expected-error{{type 'X2d' does not conform to protocol 'P2
113113
}
114114

115115

116-
// SR-12707
116+
// https://github.com/apple/swift/issues/55151
117117

118-
class SR_12707_C<T> {}
118+
class GenClass<T> {}
119119

120120
// Regular type witnesses
121-
protocol SR_12707_P1 {
121+
protocol P3a {
122122
associatedtype A
123-
associatedtype B: SR_12707_C<(A, Self)> // expected-note {{'B' declared here}}
123+
associatedtype B: GenClass<(A, Self)> // expected-note {{'B' declared here}}
124124
}
125-
struct SR_12707_Conform_P1: SR_12707_P1 {
125+
struct S3a: P3a {
126126
typealias A = Never
127-
typealias B = SR_12707_C<(A, SR_12707_Conform_P1)>
127+
typealias B = GenClass<(A, S3a)>
128128
}
129129

130130
// Type witness in protocol extension
131-
protocol SR_12707_P2: SR_12707_P1 {}
132-
extension SR_12707_P2 {
133-
typealias B = SR_12707_C<(A, Self)> // expected-warning {{typealias overriding associated type 'B' from protocol 'SR_12707_P1' is better expressed as same-type constraint on the protocol}}
131+
protocol P3b: P3a {}
132+
extension P3b {
133+
typealias B = GenClass<(A, Self)> // expected-warning {{typealias overriding associated type 'B' from protocol 'P3a' is better expressed as same-type constraint on the protocol}}
134134
}
135-
struct SR_12707_Conform_P2: SR_12707_P2 {
135+
struct S3b: P3b {
136136
typealias A = Never
137137
}
138138

139139
// FIXME: resolveTypeWitnessViaLookup must not happen independently in the
140140
// general case.
141-
protocol SR_12707_FIXME_P3 {
142-
associatedtype A: SR_12707_C<B> // expected-note {{protocol requires nested type 'A'; do you want to add it?}}
141+
protocol P4 {
142+
associatedtype A: GenClass<B> // expected-note {{protocol requires nested type 'A'; do you want to add it?}}
143143
associatedtype B
144144
}
145-
struct SR_12707_FIXME_Conform_P3: SR_12707_FIXME_P3 { // expected-error {{type 'SR_12707_FIXME_Conform_P3' does not conform to protocol 'SR_12707_FIXME_P3'}}
146-
typealias A = SR_12707_C<B> // expected-note {{possibly intended match 'SR_12707_FIXME_Conform_P3.A' (aka 'SR_12707_C<Never>') does not inherit from 'SR_12707_C<SR_12707_FIXME_Conform_P3.B>'}}
145+
struct S4: P4 { // expected-error {{type 'S4' does not conform to protocol 'P4'}}
146+
typealias A = GenClass<B> // expected-note {{possibly intended match 'S4.A' (aka 'GenClass<Never>') does not inherit from 'GenClass<S4.B>'}}
147147
typealias B = Never
148148
}
149149

150150
// FIXME: Associated type inference via value witnesses should consider
151151
// tentative witnesses when checking a candidate.
152-
protocol SR_12707_FIXME_P4 {
152+
protocol P5 {
153153
associatedtype X = Never
154154

155-
associatedtype A: SR_12707_C<X> // expected-note {{unable to infer associated type 'A' for protocol 'SR_12707_FIXME_P4'}}
155+
associatedtype A: GenClass<X> // expected-note {{unable to infer associated type 'A' for protocol 'P5'}}
156156
func foo(arg: A)
157157
}
158-
struct SR_12707_FIXME_Conform_P4: SR_12707_FIXME_P4 { // expected-error {{type 'SR_12707_FIXME_Conform_P4' does not conform to protocol 'SR_12707_FIXME_P4'}}
159-
func foo(arg: SR_12707_C<Never>) {} // expected-note {{candidate would match and infer 'A' = 'SR_12707_C<Never>' if 'SR_12707_C<Never>' inherited from 'SR_12707_C<SR_12707_FIXME_Conform_P4.X>'}}
158+
struct S5: P5 { // expected-error {{type 'S5' does not conform to protocol 'P5'}}
159+
func foo(arg: GenClass<Never>) {} // expected-note {{candidate would match and infer 'A' = 'GenClass<Never>' if 'GenClass<Never>' inherited from 'GenClass<S5.X>'}}
160160
}
161161

162162
// Abstract type witnesses.
163-
protocol SR_12707_P5a {
163+
protocol P6a {
164164
associatedtype X = Never
165165

166-
associatedtype A: SR_12707_C<X>
167-
associatedtype B: SR_12707_C<X>
166+
associatedtype A: GenClass<X>
167+
associatedtype B: GenClass<X>
168168
}
169-
protocol SR_12707_P5b: SR_12707_P5a where B == SR_12707_C<X> {
170-
associatedtype C: SR_12707_C<Self> = SR_12707_C<Self>
169+
protocol P6b: P6a where B == GenClass<X> {
170+
associatedtype C: GenClass<Self> = GenClass<Self>
171171
}
172-
struct SR_12707_Conform_P5<A: SR_12707_C<Never>>: SR_12707_P5b {}
172+
struct S6<A: GenClass<Never>>: P6b {}

test/decl/protocol/conforms/circular_validation.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ struct S : P { // expected-error {{type 'S' does not conform to protocol 'P'}}
1212
var x = S.x // expected-note {{candidate references itself}}
1313
}
1414

15+
// https://github.com/apple/swift/issues/51713
1516
// FIXME: Lousy diagnostics on this case.
16-
protocol SR9224_Foo: SR9224_Foobar {} // expected-error {{protocol 'SR9224_Foo' refines itself}}
17-
protocol SR9224_Bar: SR9224_Foobar {}
18-
typealias SR9224_Foobar = SR9224_Foo & SR9224_Bar
17+
protocol P1_51713: P1P2_51713 {} // expected-error {{protocol 'P1_51713' refines itself}}
18+
protocol P2_51713: P1P2_51713 {}
19+
typealias P1P2_51713 = P1_51713 & P2_51713

test/decl/protocol/conforms/fixit_stub_editor.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ class Class4 {}
102102
extension Class4: PropertyMutabilityProto { // expected-error{{type 'Class4' does not conform to protocol 'PropertyMutabilityProto'}} expected-note{{do you want to add protocol stubs?}} {{44-44=\n var computed: Int {\n get {\n <#code#>\n \}\n set {\n <#code#>\n \}\n \}\n\n var stored: Int {\n get {\n <#code#>\n \}\n set {\n <#code#>\n \}\n \}\n}}
103103
}
104104

105-
// https://bugs.swift.org/browse/SR-9868
105+
// https://github.com/apple/swift/issues/52274
106+
106107
protocol FooProto {
107108
typealias CompletionType = (Int) -> Void
108109
func doSomething(then completion: @escaping CompletionType)

test/decl/protocol/conforms/objc_from_witness_corner_case.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// to validateDecl() getting called on a declaration. In this case, we
77
// did not infer @objc from witnessed protocol requirements as required.
88
//
9-
// https://bugs.swift.org/browse/SR-10257
9+
// https://github.com/apple/swift/issues/52657
1010

1111
@objc public protocol P {
1212
@objc optional func f()

test/decl/protocol/conforms/self.swift

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ class NonFinalClass : P {
4848
subscript(_: T) -> Self { self }
4949
}
5050

51-
// Test for default implementation that comes from a constrained extension
52-
// - https://bugs.swift.org/browse/SR-7422
51+
// (https://github.com/apple/swift/issues/49965) Test for default implementation
52+
// that comes from a constrained extension.
5353

5454
// FIXME: Better error message here?
5555

@@ -78,7 +78,7 @@ extension HasDefault where Self : SeriousClass {
7878

7979
extension SeriousClass : HasDefault {}
8080

81-
// https://bugs.swift.org/browse/SR-7428
81+
// https://github.com/apple/swift/issues/49971
8282

8383
protocol Node {
8484
associatedtype ValueType = Int
@@ -94,28 +94,30 @@ extension Node {
9494

9595
class IntNode: Node {}
9696

97-
// SR-8902
98-
protocol P8902 {
97+
// https://github.com/apple/swift/issues/51408
98+
99+
protocol P_51408 {
99100
associatedtype A
100101
func f(_ x: A) -> Self
101102
}
102-
struct S : P8902 {
103-
func f(_ x: Bool) -> S { fatalError() }
103+
struct S : P_51408 {
104+
func f(_ x: Bool) -> S {}
104105
}
105-
class C8902 : P8902 {
106-
func f(_ x: Bool) -> C8902 { fatalError() } // expected-error {{method 'f' in non-final class 'C8902' must return 'Self' to conform to protocol 'P8902'}}
106+
class C1_51408 : P_51408 {
107+
func f(_ x: Bool) -> C1_51408 {} // expected-error {{method 'f' in non-final class 'C1_51408' must return 'Self' to conform to protocol 'P_51408'}}
107108
}
108-
final class C8902b : P8902 {
109-
func f(_ x: Bool) -> C8902b { fatalError() }
109+
final class C2_51408 : P_51408 {
110+
func f(_ x: Bool) -> C2_51408 {}
110111
}
111-
class C8902c : P8902 {
112-
func f(_ x: Bool) -> Self { fatalError() }
112+
class C3_51408 : P_51408 {
113+
func f(_ x: Bool) -> Self {}
113114
}
114-
protocol P8902complex {
115+
116+
protocol P_51408_Complex {
115117
associatedtype A
116118
func f() -> (A, Self?)
117119
}
118-
final class C8902complex : P8902complex {
119-
func f() -> (Bool, C8902complex?) { fatalError() }
120+
final class C_51408_Complex : P_51408_Complex {
121+
func f() -> (Bool, C_51408_Complex?) {}
120122
}
121123

test/decl/protocol/invalid_accessors_implementation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
//===---
5-
// SR-13963
5+
// https://github.com/apple/swift/issues/56360
66
//===---
77

88
protocol Protocol1 {

test/decl/protocol/protocols.swift

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -477,70 +477,70 @@ extension LetThereBeCrash {
477477
// expected-error@-2 {{'let' property 'xs' may not be initialized directly; use "self.init(...)" or "self = ..." instead}}
478478
}
479479

480-
// SR-11412
480+
// https://github.com/apple/swift/issues/53813
481481
// Offer fix-it to conform type of context to the missing protocols
482482

483-
protocol SR_11412_P1 {}
484-
protocol SR_11412_P2 {}
485-
protocol SR_11412_P3 {}
486-
protocol SR_11412_P4: AnyObject {}
483+
protocol P1_53813 {}
484+
protocol P2_53813 {}
485+
protocol P3_53813 {}
486+
protocol P4_53813: AnyObject {}
487487

488-
class SR_11412_C0 {
489-
var foo1: SR_11412_P1?
490-
var foo2: (SR_11412_P1 & SR_11412_P2)?
491-
weak var foo3: SR_11412_P4?
488+
class C0_53813 {
489+
var foo1: P1_53813?
490+
var foo2: (P1_53813 & P2_53813)?
491+
weak var foo3: P4_53813?
492492
}
493493

494494
// Context has no inherited types and does not conform to protocol //
495495

496-
class SR_11412_C1 {
497-
let c0 = SR_11412_C0()
496+
class C1_53813 {
497+
let c0 = C0_53813()
498498

499499
func conform() {
500-
c0.foo1 = self // expected-error {{cannot assign value of type 'SR_11412_C1' to type '(any SR_11412_P1)?'}}
501-
// expected-note@-1 {{add missing conformance to 'SR_11412_P1' to class 'SR_11412_C1'}}{{18-18=: SR_11412_P1}}
500+
c0.foo1 = self // expected-error {{cannot assign value of type 'C1_53813' to type '(any P1_53813)?'}}
501+
// expected-note@-1 {{add missing conformance to 'P1_53813' to class 'C1_53813'}}{{15-15=: P1_53813}}
502502
}
503503
}
504504

505505
// Context has no inherited types and does not conform to protocol composition //
506506

507-
class SR_11412_C2 {
508-
let c0 = SR_11412_C0()
507+
class C2_53813 {
508+
let c0 = C0_53813()
509509

510510
func conform() {
511-
c0.foo2 = self // expected-error {{cannot assign value of type 'SR_11412_C2' to type '(any SR_11412_P1 & SR_11412_P2)?'}}
512-
// expected-note@-1 {{add missing conformance to 'SR_11412_P1 & SR_11412_P2' to class 'SR_11412_C2'}}{{18-18=: SR_11412_P1 & SR_11412_P2}}
511+
c0.foo2 = self // expected-error {{cannot assign value of type 'C2_53813' to type '(any P1_53813 & P2_53813)?'}}
512+
// expected-note@-1 {{add missing conformance to 'P1_53813 & P2_53813' to class 'C2_53813'}}{{15-15=: P1_53813 & P2_53813}}
513513
}
514514
}
515515

516516
// Context already has an inherited type, but does not conform to protocol //
517517

518-
class SR_11412_C3: SR_11412_P3 {
519-
let c0 = SR_11412_C0()
518+
class C3_53813: P3_53813 {
519+
let c0 = C0_53813()
520520

521521
func conform() {
522-
c0.foo1 = self // expected-error {{cannot assign value of type 'SR_11412_C3' to type '(any SR_11412_P1)?'}}
523-
// expected-note@-1 {{add missing conformance to 'SR_11412_P1' to class 'SR_11412_C3'}}{{31-31=, SR_11412_P1}}
522+
c0.foo1 = self // expected-error {{cannot assign value of type 'C3_53813' to type '(any P1_53813)?'}}
523+
// expected-note@-1 {{add missing conformance to 'P1_53813' to class 'C3_53813'}}{{25-25=, P1_53813}}
524524
}
525525
}
526526

527527
// Context conforms to only one protocol in the protocol composition //
528528

529-
class SR_11412_C4: SR_11412_P1 {
530-
let c0 = SR_11412_C0()
529+
class C4_53813: P1_53813 {
530+
let c0 = C0_53813()
531531

532532
func conform() {
533-
c0.foo2 = self // expected-error {{cannot assign value of type 'SR_11412_C4' to type '(any SR_11412_P1 & SR_11412_P2)?'}}
534-
// expected-note@-1 {{add missing conformance to 'SR_11412_P1 & SR_11412_P2' to class 'SR_11412_C4'}}{{31-31=, SR_11412_P2}}
533+
c0.foo2 = self // expected-error {{cannot assign value of type 'C4_53813' to type '(any P1_53813 & P2_53813)?'}}
534+
// expected-note@-1 {{add missing conformance to 'P1_53813 & P2_53813' to class 'C4_53813'}}{{25-25=, P2_53813}}
535535
}
536536
}
537537

538538
// Context is a value type, but protocol requires class //
539539

540-
struct SR_11412_S0 {
541-
let c0 = SR_11412_C0()
540+
struct S0_53813 {
541+
let c0 = C0_53813()
542542

543543
func conform() {
544-
c0.foo3 = self // expected-error {{cannot assign value of type 'SR_11412_S0' to type '(any SR_11412_P4)?'}}
544+
c0.foo3 = self // expected-error {{cannot assign value of type 'S0_53813' to type '(any P4_53813)?'}}
545545
}
546546
}

test/decl/protocol/recursive_requirement.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ protocol AsExistentialAssocTypeAgainB {
106106
func aMethod(_ object : AsExistentialAssocTypeAgainA) // expected-error {{use of protocol 'AsExistentialAssocTypeAgainA' as a type must be written 'any AsExistentialAssocTypeAgainA'}}
107107
}
108108

109-
// SR-547
109+
// https://github.com/apple/swift/issues/43164
110+
110111
protocol A {
111112
associatedtype B1: B
112113
associatedtype C1: C

test/decl/protocol/recursive_requirement_ok.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ func testP<T: P>(_ t: T) {
1515
testP(t.assoc.assoc.assoc.assoc.assoc.assoc.assoc)
1616
}
1717

18-
// SR-5485
18+
// https://github.com/apple/swift/issues/48057
19+
1920
protocol P1 {
2021
associatedtype X : P2
2122
}
@@ -27,7 +28,8 @@ protocol P2 {
2728
associatedtype Z : P1
2829
}
2930

30-
// SR-5473
31+
// https://github.com/apple/swift/issues/48045
32+
3133
protocol P3 {
3234
associatedtype X : P4
3335
}
@@ -53,7 +55,8 @@ protocol P6 : P5 {
5355
// CHECK: Generic signature: <Self where Self : P6, Self.[P5]X == Self.[P6]Y.[P5]X>
5456
extension P6 where X == Y.X { }
5557

56-
// SR-5601
58+
// https://github.com/apple/swift/issues/48173
59+
5760
protocol P7 {
5861
associatedtype X: P9 where X.Q == Self, X.R == UInt8
5962
associatedtype Y: P9 where Y.Q == Self, Y.R == UInt16
@@ -73,7 +76,8 @@ struct S9<E> : P9 {
7376
typealias Q = A7
7477
}
7578

76-
// SR-5610
79+
// https://github.com/apple/swift/issues/48180
80+
7781
protocol P10 {
7882
associatedtype X : P11 where X.Q == Self
7983
}

0 commit comments

Comments
 (0)