Skip to content

Commit 1ff6d8a

Browse files
committed
Gardening: Migrate test suite to GH issues: type
1 parent 234dea0 commit 1ff6d8a

File tree

7 files changed

+38
-27
lines changed

7 files changed

+38
-27
lines changed

test/type/array.swift

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,15 @@ func passAssocType<T : HasAssocType>(_ t: T) {
114114
takesAssocType(t, [T.A](), [T.A?]())
115115
}
116116

117-
// SR-11134
118-
119-
let sr_11134_1 = [[1, 2, 3][0]] // ok
120-
let sr_11134_2 = [[1, 2, 3] [1]] // expected-warning {{unexpected subscript in array literal; did you mean to write two separate elements instead?}}
121-
// expected-note@-1 {{add a separator between the elements}}{{28-28=,}}
122-
// expected-note@-2 {{remove the space between the elements to silence this warning}}{{28-29=}}
123-
let sr_11134_3 = [
124-
[1, 2, 3] [1] // expected-warning {{unexpected subscript in array literal; did you mean to write two separate elements instead?}}
125-
// expected-note@-1 {{add a separator between the elements}}{{12-12=,}}
126-
// expected-note@-2 {{remove the space between the elements to silence this warning}}{{12-13=}}
127-
]
117+
// https://github.com/apple/swift/issues/53530
118+
do {
119+
let _ = [[1, 2, 3][0]] // ok
120+
let _ = [[1, 2, 3] [1]] // expected-warning {{unexpected subscript in array literal; did you mean to write two separate elements instead?}}
121+
// expected-note@-1 {{add a separator between the elements}}{{21-21=,}}
122+
// expected-note@-2 {{remove the space between the elements to silence this warning}}{{21-22=}}
123+
let _ = [
124+
[1, 2, 3] [1] // expected-warning {{unexpected subscript in array literal; did you mean to write two separate elements instead?}}
125+
// expected-note@-1 {{add a separator between the elements}}{{14-14=,}}
126+
// expected-note@-2 {{remove the space between the elements to silence this warning}}{{14-15=}}
127+
]
128+
}

test/type/opaque.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,12 +537,14 @@ func test_diagnostic_with_contextual_generic_params() {
537537
}
538538
}
539539

540-
// SR-10988 - Suggest `return` when the last statement of a multi-statement function body would be a valid return value
540+
// https://github.com/apple/swift/issues/53378
541+
// Suggest `return` when the last statement of a multi-statement function body
542+
// would be a valid return value
541543
protocol P1 {
542544
}
543545
protocol P2 {
544546
}
545-
func sr10988() {
547+
do {
546548
func test() -> some Numeric {
547549
// expected-error@-1 {{function declares an opaque return type, but has no return statements in its body from which to infer an underlying type}}
548550
let x = 0

test/type/parameterized_protocol.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ protocol SequenceWrapperProtocol {
8989
associatedtype E
9090
}
9191

92-
// https://bugs.swift.org/browse/SR-15979 - the GenericSignatureBuilder doesn't like this protocol.
93-
92+
// https://github.com/apple/swift/issues/58240
93+
// the GenericSignatureBuilder doesn't like this protocol.
94+
//
9495
// CHECK-LABEL: .Recursive@
9596
// CHECK-NEXT: Requirement signature: <Self where Self.[Recursive]B == Self.[Recursive]D.[Recursive]B, Self.[Recursive]C == Self.[Recursive]D.[Recursive]C, Self.[Recursive]D : Recursive>
9697
protocol Recursive<B, C> {

test/type/protocol_composition.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,11 @@ struct S03: Optional<P5> & P6 {} // expected-error {{non-protocol, non-class typ
160160
struct S04<T : P5 & (P6)> {}
161161
struct S05<T> where T : P5? & P6 {} // expected-error {{non-protocol, non-class type '(any P5)?' cannot be used within a protocol-constrained type}}
162162

163-
// SR-3124 - Protocol Composition Often Migrated Incorrectly
164-
struct S3124<T: protocol<P1, P3>> {} // expected-error {{'protocol<...>' composition syntax has been removed; join the protocols using '&'}} {{17-34=P1 & P3>}}
165-
func f3124_1<U where U: protocol<P1, P3>>(x: U) {} // expected-error {{'protocol<...>' composition syntax has been removed; join the protocols using '&'}} {{25-42=P1 & P3>}} // expected-error {{'where' clause}}
166-
func f3124_2<U : protocol<P1>>(x: U) {} // expected-error {{'protocol<...>' composition syntax has been removed and is not needed here}} {{18-31=P1>}}
163+
// https://github.com/apple/swift/issues/45712
164+
// Protocol Composition Often Migrated Incorrectly
165+
struct S_45712<T: protocol<P1, P3>> {} // expected-error {{'protocol<...>' composition syntax has been removed; join the protocols using '&'}} {{19-36=P1 & P3>}}
166+
func f1_45712<U where U: protocol<P1, P3>>(_: U) {} // expected-error {{'protocol<...>' composition syntax has been removed; join the protocols using '&'}} {{26-43=P1 & P3>}} // expected-error {{'where' clause}}
167+
func f2_45712<U : protocol<P1>>(_: U) {} // expected-error {{'protocol<...>' composition syntax has been removed and is not needed here}} {{19-32=P1>}}
167168

168169
// Make sure we correctly form compositions in expression context
169170
func takesP1AndP2(_: [AnyObject & P1 & P2]) {}

test/type/protocol_types.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func testHasAssoc(_ x: Any, _: HasAssoc) { // expected-error {{use of protocol '
9696
}
9797
}
9898

99-
// SR-38
99+
// https://github.com/apple/swift/issues/42661
100100
var b: HasAssoc // expected-error {{use of protocol 'HasAssoc' as a type must be written 'any HasAssoc'}}
101101

102102
// Further generic constraint error testing - typealias used inside statements

test/type/self.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ extension X.Inner {
2626
func foo(_ other: Self) { }
2727
}
2828

29-
// SR-695
29+
// https://github.com/apple/swift/issues/43310
3030
class Mario {
3131
func getFriend() -> Self { return self } // expected-note{{overridden declaration is here}}
3232
func getEnemy() -> Mario { return self }
@@ -259,7 +259,8 @@ class Foo {
259259
}()
260260
}
261261

262-
// https://bugs.swift.org/browse/SR-11681 - duplicate diagnostics
262+
// https://github.com/apple/swift/issues/54090 (duplicate diagnostics)
263+
263264
struct Box<T> {
264265
let boxed: T
265266
}
@@ -268,6 +269,7 @@ class Boxer {
268269
lazy var s = Box<Self>(boxed: self as! Self)
269270
// expected-error@-1 {{stored property cannot have covariant 'Self' type}}
270271
// expected-error@-2 {{mutable property cannot have covariant 'Self' type}}
272+
// FIXME: [DiagQoI] We can do better than this.
271273

272274
var t = Box<Self>(boxed: Self())
273275
// expected-error@-1 {{stored property cannot have covariant 'Self' type}}
@@ -276,7 +278,8 @@ class Boxer {
276278
required init() {}
277279
}
278280

279-
// https://bugs.swift.org/browse/SR-12133 - a type named 'Self' should be found first
281+
// https://github.com/apple/swift/issues/54568
282+
// A type named 'Self' should be found first
280283
struct OuterType {
281284
struct `Self` {
282285
let string: String
@@ -361,7 +364,8 @@ do {
361364
}
362365
}
363366

364-
// https://bugs.swift.org/browse/SR-14731
367+
// https://github.com/apple/swift/issues/57081
368+
365369
struct Generic<T> {
366370
func foo() -> Self<Int> {}
367371
// expected-error@-1 {{cannot specialize 'Self'}}

test/type/types.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,12 @@ let _ : inout @convention(c) (Int) -> Int // expected-error {{'inout' may only b
186186
func foo3(inout a: Int -> Void) {} // expected-error {{'inout' before a parameter name is not allowed, place it before the parameter type instead}} {{11-16=}} {{20-20=inout }}
187187
// expected-error @-1 {{single argument function types require parentheses}} {{20-20=(}} {{23-23=)}}
188188

189-
func sr5505(arg: Int) -> String {
190-
return "hello"
189+
// https://github.com/apple/swift/issues/48077
190+
do {
191+
func imAFunction(arg: Int) -> String {}
192+
var _: imAFunction = imAFunction
193+
// expected-error@-1 {{cannot find type 'imAFunction' in scope}}
191194
}
192-
var _: sr5505 = sr5505 // expected-error {{cannot find type 'sr5505' in scope}}
193195

194196
typealias A = (inout Int ..., Int ... = [42, 12]) -> Void // expected-error {{'inout' must not be used on variadic parameters}}
195197
// expected-error@-1 {{only a single element can be variadic}} {{35-39=}}

0 commit comments

Comments
 (0)