Skip to content

Commit cdded2b

Browse files
committed
Gardening: Migrate test suite to GH issues: decl
1 parent f8f9b5f commit cdded2b

File tree

4 files changed

+83
-80
lines changed

4 files changed

+83
-80
lines changed

test/decl/circularity.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ class D4 : C4, P1 { // expected-note 3 {{through reference here}}
110110
}
111111
}
112112

113-
// SR-12236
113+
// https://github.com/apple/swift/issues/54662
114114
// N.B. This used to compile in 5.1.
115-
protocol SR12236 { }
116-
class SR12236_A { // expected-note {{through reference here}}
117-
typealias Nest = SR12236 // expected-error {{circular reference}} expected-note {{through reference here}}
115+
protocol P_54662 { }
116+
class C_54662 { // expected-note {{through reference here}}
117+
typealias Nest = P_54662 // expected-error {{circular reference}} expected-note {{through reference here}}
118118
}
119-
extension SR12236_A: SR12236_A.Nest { }
119+
extension C_54662: C_54662.Nest { }

test/decl/overload.swift

Lines changed: 54 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -465,25 +465,29 @@ protocol r21783216b {
465465
associatedtype `Protocol` // ok
466466
}
467467

468-
struct SR7249<T> {
469-
var x: T { fatalError() } // expected-note {{previously declared}}
468+
// https://github.com/apple/swift/issues/49797
469+
470+
struct S_49797<T> {
471+
var x: T { get {} } // expected-note {{previously declared}}
470472
var y: Int // expected-note {{previously declared}}
471473
var z: Int // expected-note {{previously declared}}
472474
}
473475

474-
extension SR7249 {
475-
var x: Int { fatalError() } // expected-warning{{redeclaration of 'x' is deprecated and will be an error in Swift 5}}
476-
var y: T { fatalError() } // expected-warning{{redeclaration of 'y' is deprecated and will be an error in Swift 5}}
477-
var z: Int { fatalError() } // expected-error{{invalid redeclaration of 'z'}}
476+
extension S_49797 {
477+
var x: Int { get {} } // expected-warning{{redeclaration of 'x' is deprecated and will be an error in Swift 5}}
478+
var y: T { get {} } // expected-warning{{redeclaration of 'y' is deprecated and will be an error in Swift 5}}
479+
var z: Int { get {} } // expected-error{{invalid redeclaration of 'z'}}
478480
}
479481

480482
// A constrained extension is okay.
481-
extension SR7249 where T : P1 {
482-
var x: Int { fatalError() }
483-
var y: T { fatalError() }
484-
var z: Int { fatalError() }
483+
extension S_49797 where T : P1 {
484+
var x: Int { get {} }
485+
var y: T { get {} }
486+
var z: Int { get {} }
485487
}
486488

489+
// https://github.com/apple/swift/issues/49798
490+
487491
protocol P3 {
488492
var i: Int { get }
489493
subscript(i: Int) -> String { get }
@@ -494,135 +498,129 @@ extension P3 {
494498
subscript(i: Int) -> String { return "" }
495499
}
496500

497-
struct SR7250<T> : P3 {}
501+
struct S_49798<T> : P3 {}
498502

499-
extension SR7250 where T : P3 {
500-
var i: Int { return 0 }
501-
subscript(i: Int) -> String { return "" }
503+
extension S_49798 where T : P3 {
504+
var i: Int { get {} }
505+
subscript(i: Int) -> String { get {} }
502506
}
503507

504-
// SR-10084
508+
// https://github.com/apple/swift/issues/52486
505509

506-
struct SR_10084_S {
510+
struct S_52486 {
507511
let name: String
508512
}
509513

510-
enum SR_10084_E {
511-
case foo(SR_10084_S) // expected-note {{'foo' previously declared here}}
514+
enum E_52486 {
515+
case foo(S_52486) // expected-note {{'foo' previously declared here}}
512516

513-
static func foo(_ name: String) -> SR_10084_E { // Okay
514-
return .foo(SR_10084_S(name: name))
517+
static func foo(_ name: String) -> E_52486 { // Okay
518+
return .foo(S_52486(name: name))
515519
}
516520

517-
func foo(_ name: Bool) -> SR_10084_E { // Okay
518-
return .foo(SR_10084_S(name: "Test"))
521+
func foo(_ name: Bool) -> E_52486 { // Okay
522+
return .foo(S_52486(name: "Test"))
519523
}
520524

521-
static func foo(_ value: SR_10084_S) -> SR_10084_E { // expected-error {{invalid redeclaration of 'foo'}}
525+
static func foo(_ value: S_52486) -> E_52486 { // expected-error {{invalid redeclaration of 'foo'}}
522526
return .foo(value)
523527
}
524528
}
525529

526-
enum SR_10084_E_1 {
527-
static func foo(_ name: String) -> SR_10084_E_1 { // Okay
528-
return .foo(SR_10084_S(name: name))
530+
enum E1_52486 {
531+
static func foo(_ name: String) -> E1_52486 { // Okay
532+
return .foo(S_52486(name: name))
529533
}
530534

531-
static func foo(_ value: SR_10084_S) -> SR_10084_E_1 { // expected-note {{'foo' previously declared here}}
535+
static func foo(_ value: S_52486) -> E1_52486 { // expected-note {{'foo' previously declared here}}
532536
return .foo(value)
533537
}
534538

535-
case foo(SR_10084_S) // expected-error {{invalid redeclaration of 'foo'}}
539+
case foo(S_52486) // expected-error {{invalid redeclaration of 'foo'}}
536540
}
537541

538-
enum SR_10084_E_2 {
542+
enum E2_52486 {
539543
case fn(() -> Void) // expected-note {{'fn' previously declared here}}
540544

541-
static func fn(_ x: @escaping () -> Void) -> SR_10084_E_2 { // expected-error {{invalid redeclaration of 'fn'}}
542-
fatalError()
543-
}
545+
static func fn(_ x: @escaping () -> Void) -> E2_52486 {} // expected-error {{invalid redeclaration of 'fn'}}
544546

545-
static func fn(_ x: @escaping () -> Int) -> SR_10084_E_2 { // Okay
546-
fatalError()
547-
}
547+
static func fn(_ x: @escaping () -> Int) -> E2_52486 {} // Okay
548548

549-
static func fn(_ x: @escaping () -> Bool) -> SR_10084_E_2 { // Okay
550-
fatalError()
551-
}
549+
static func fn(_ x: @escaping () -> Bool) -> E2_52486 {} // Okay
552550
}
553551

554552
// N.B. Redeclaration checks don't see this case because `protocol A` is invalid.
555-
enum SR_10084_E_3 {
553+
enum E3_52486 {
556554
protocol A {} //expected-error {{protocol 'A' cannot be nested inside another declaration}}
557555
case A
558556
}
559557

560-
enum SR_10084_E_4 {
558+
enum E4_52486 {
561559
class B {} // expected-note {{'B' previously declared here}}
562560
case B // expected-error {{invalid redeclaration of 'B'}}
563561
}
564562

565-
enum SR_10084_E_5 {
563+
enum E5_52486 {
566564
struct C {} // expected-note {{'C' previously declared here}}
567565
case C // expected-error {{invalid redeclaration of 'C'}}
568566
}
569567

570568
// N.B. Redeclaration checks don't see this case because `protocol D` is invalid.
571-
enum SR_10084_E_6 {
569+
enum E6_52486 {
572570
case D
573571
protocol D {} //expected-error {{protocol 'D' cannot be nested inside another declaration}}
574572
}
575573

576-
enum SR_10084_E_7 {
574+
enum E7_52486 {
577575
case E // expected-note {{'E' previously declared here}}
578576
class E {} // expected-error {{invalid redeclaration of 'E'}}
579577
}
580578

581-
enum SR_10084_E_8 {
579+
enum E8_52486 {
582580
case F // expected-note {{'F' previously declared here}}
583581
struct F {} // expected-error {{invalid redeclaration of 'F'}}
584582
}
585583

586-
enum SR_10084_E_9 {
584+
enum E9_52486 {
587585
case A // expected-note {{'A' previously declared here}} expected-note {{found this candidate}}
588-
static let A: SR_10084_E_9 = .A // expected-error {{invalid redeclaration of 'A'}}
586+
static let A: E9_52486 = .A // expected-error {{invalid redeclaration of 'A'}}
589587
// expected-error@-1 {{ambiguous use of 'A'}} expected-note@-1 {{found this candidate}}
590588
}
591589

592-
enum SR_10084_E_10 {
593-
static let A: SR_10084_E_10 = .A // expected-note {{'A' previously declared here}}
590+
enum E10_52486 {
591+
static let A: E10_52486 = .A // expected-note {{'A' previously declared here}}
594592
// expected-error@-1 {{ambiguous use of 'A'}} expected-note@-1 {{found this candidate}}
595593
case A // expected-error {{invalid redeclaration of 'A'}} expected-note {{found this candidate}}
596594
}
597595

598-
enum SR_10084_E_11 {
596+
enum E11_52486 {
599597
case A // expected-note {{'A' previously declared here}} expected-note {{found this candidate}}
600-
static var A: SR_10084_E_11 = .A // expected-error {{invalid redeclaration of 'A'}}
598+
static var A: E11_52486 = .A // expected-error {{invalid redeclaration of 'A'}}
601599
// expected-error@-1 {{ambiguous use of 'A'}} expected-note@-1 {{found this candidate}}
602600
}
603601

604-
enum SR_10084_E_12 {
605-
static var A: SR_10084_E_12 = .A // expected-note {{'A' previously declared here}}
602+
enum E12_52486 {
603+
static var A: E12_52486 = .A // expected-note {{'A' previously declared here}}
606604
// expected-error@-1 {{ambiguous use of 'A'}} expected-note@-1 {{found this candidate}}
607605
case A // expected-error {{invalid redeclaration of 'A'}} expected-note {{found this candidate}}
608606
}
609607

610-
enum SR_10084_E_13 {
608+
enum E13_52486 {
611609
case X // expected-note {{'X' previously declared here}}
612610
struct X<T> {} // expected-error {{invalid redeclaration of 'X'}}
613611
}
614612

615-
enum SR_10084_E_14 {
613+
enum E14_52486 {
616614
struct X<T> {} // expected-note {{'X' previously declared here}}
617615
case X // expected-error {{invalid redeclaration of 'X'}}
618616
}
619617

620-
enum SR_10084_E_15 {
618+
enum E15_52486 {
621619
case Y // expected-note {{'Y' previously declared here}}
622620
typealias Y = Int // expected-error {{invalid redeclaration of 'Y'}}
623621
}
624622

625-
enum SR_10084_E_16 {
623+
enum E16_52486 {
626624
typealias Z = Int // expected-note {{'Z' previously declared here}}
627625
case Z // expected-error {{invalid redeclaration of 'Z'}}
628626
}

test/decl/overload_swift4.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
// RUN: %target-typecheck-verify-swift -swift-version 4
22

3-
struct SR7251<T> {
3+
// https://github.com/apple/swift/issues/49799
4+
5+
struct S1<T> {
46
struct j {} // expected-note {{previously declared here}}
5-
static var k: Int { return 0 } // expected-note {{previously declared here}}
7+
static var k: Int { get {} } // expected-note {{previously declared here}}
68
}
7-
extension SR7251 {
8-
static var i: Int { return 0 }
9+
extension S1 {
10+
static var i: Int { get {} }
911
// expected-note@-1 {{previously declared here}}
1012
// expected-note@-2 {{previously declared here}}
1113

1214
struct i {} // expected-warning {{redeclaration of 'i' is deprecated and will be an error in Swift 5}}
1315
typealias i = Int // expected-warning {{redeclaration of 'i' is deprecated and will be an error in Swift 5}}
1416

15-
static var j: Int { return 0 } // expected-warning {{redeclaration of 'j' is deprecated and will be an error in Swift 5}}
17+
static var j: Int { get {} } // expected-warning {{redeclaration of 'j' is deprecated and will be an error in Swift 5}}
1618

1719
struct k {} // expected-error{{invalid redeclaration of 'k'}}
1820
}

test/decl/overload_swift5.swift

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
// RUN: %target-typecheck-verify-swift -swift-version 5
22

3-
struct SR7251<T> {
3+
// https://github.com/apple/swift/issues/49799
4+
5+
struct S1<T> {
46
struct j {} // expected-note {{previously declared here}}
5-
static var k: Int { return 0 } // expected-note {{previously declared here}}
7+
static var k: Int { get {} } // expected-note {{previously declared here}}
68
}
7-
extension SR7251 {
8-
static var i: Int { return 0 } // expected-note {{previously declared here}}
9+
extension S1 {
10+
static var i: Int { get {} } // expected-note {{previously declared here}}
911
struct i {} // expected-error{{invalid redeclaration of 'i'}}
10-
static var j: Int { return 0 } // expected-error{{invalid redeclaration of 'j'}}
12+
static var j: Int { get {} } // expected-error{{invalid redeclaration of 'j'}}
1113
struct k {} // expected-error{{invalid redeclaration of 'k'}}
1214
}
1315

14-
struct SR7249<T> {
15-
var x: T { fatalError() } // expected-note {{previously declared}}
16-
var y: Int // expected-note {{previously declared}}
17-
var z: Int // expected-note {{previously declared}}
18-
}
16+
// https://github.com/apple/swift/issues/49797
1917

20-
extension SR7249 {
21-
var x: Int { fatalError() } // expected-error{{invalid redeclaration of 'x'}}
22-
var y: T { fatalError() } // expected-error{{invalid redeclaration of 'y'}}
23-
var z: Int { fatalError() } // expected-error{{invalid redeclaration of 'z'}}
18+
struct S2<T> {
19+
var x: T { get {} } // expected-note {{previously declared}}
20+
var y: Int // expected-note {{previously declared}}
21+
var z: Int // expected-note {{previously declared}}
22+
}
23+
extension S2 {
24+
var x: Int { get {} } // expected-error{{invalid redeclaration of 'x'}}
25+
var y: T { get {} } // expected-error{{invalid redeclaration of 'y'}}
26+
var z: Int { get {} } // expected-error{{invalid redeclaration of 'z'}}
2427
}

0 commit comments

Comments
 (0)