Skip to content

Commit 24d1fbb

Browse files
committed
Gardening: Migrate test suite to GH issues: Compatibility
1 parent b0fb7c5 commit 24d1fbb

File tree

5 files changed

+73
-70
lines changed

5 files changed

+73
-70
lines changed

test/Compatibility/exhaustive_switch.swift

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,8 @@ func checkLiteralTuples() {
803803
}
804804
}
805805

806-
func sr6975() {
806+
// https://github.com/apple/swift/issues/49523
807+
do {
807808
enum E {
808809
case a, b
809810
}
@@ -1177,42 +1178,43 @@ extension Result where T == NoError {
11771178
}
11781179
}
11791180

1180-
enum SR10301<T,E> {
1181-
case value(T)
1182-
case error(E)
1183-
}
1184-
enum SR10301Error: Error {
1185-
case bad
1186-
}
1181+
// https://github.com/apple/swift/issues/52701
1182+
do {
1183+
enum Enum<T,E> {
1184+
case value(T)
1185+
case error(E)
1186+
}
1187+
enum MyError: Error {
1188+
case bad
1189+
}
1190+
1191+
let foo: Enum<String, (Int, Error)>
11871192

1188-
func sr10301(_ foo: SR10301<String,(Int,Error)>) {
11891193
switch foo {
1190-
case .value: return
1191-
case .error((_, SR10301Error.bad)): return
1194+
case .value: break
1195+
case .error((_, MyError.bad)): break
11921196
case .error((_, let err)):
11931197
_ = err
1194-
return
1198+
break
11951199
}
1196-
}
11971200

1198-
func sr10301_is(_ foo: SR10301<String,(Int,Error)>) {
1201+
// 'is'
11991202
switch foo {
1200-
case .value: return
1201-
case .error((_, is SR10301Error)): return
1203+
case .value: break
1204+
case .error((_, is MyError)): break
12021205
case .error((_, let err)):
12031206
_ = err
1204-
return
1207+
break
12051208
}
1206-
}
12071209

1208-
func sr10301_as(_ foo: SR10301<String,(Int,Error)>) {
1210+
// 'as'
12091211
switch foo {
1210-
case .value: return
1211-
case .error((_, let err as SR10301Error)):
1212+
case .value: break
1213+
case .error((_, let err as MyError)):
12121214
_ = err
1213-
return
1215+
break
12141216
case .error((_, let err)):
12151217
_ = err
1216-
return
1218+
break
12171219
}
12181220
}

test/Compatibility/implicit_tupling_untupling_codegen.swift

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
// REQUIRES: executable_test
44

5+
// https://github.com/apple/swift/issues/53611
56
// Even though we test that type-checking and exhaustiveness checking work fine
67
// in the presence of implicit tupling/untupling in exhaustive_switch.swift,
78
// make sure that the "patched" patterns do not lead to incorrect codegen.
@@ -12,46 +13,46 @@ enum Untupled {
1213

1314
let u_ex = Untupled.upair(1, 2)
1415

15-
func sr11212_content_untupled_pattern_tupled1(u: Untupled) -> (Int, Int) {
16+
func content_untupled_pattern_tupled1(u: Untupled) -> (Int, Int) {
1617
switch u { case .upair((let x, let y)): return (x, y) }
1718
}
18-
print(sr11212_content_untupled_pattern_tupled1(u: u_ex))
19+
print(content_untupled_pattern_tupled1(u: u_ex))
1920
// CHECK: (1, 2)
2021

21-
func sr11212_content_untupled_pattern_tupled2(u: Untupled) -> (Int, Int) {
22+
func content_untupled_pattern_tupled2(u: Untupled) -> (Int, Int) {
2223
switch u { case .upair(let (x, y)): return (x, y) }
2324
}
24-
print(sr11212_content_untupled_pattern_tupled2(u: u_ex))
25+
print(content_untupled_pattern_tupled2(u: u_ex))
2526
// CHECK: (1, 2)
2627

27-
func sr11212_content_untupled_pattern_tupled3(u: Untupled) -> (Int, Int) {
28+
func content_untupled_pattern_tupled3(u: Untupled) -> (Int, Int) {
2829
switch u { case let .upair((x, y)): return (x, y) }
2930
}
30-
print(sr11212_content_untupled_pattern_tupled3(u: u_ex))
31+
print(content_untupled_pattern_tupled3(u: u_ex))
3132
// CHECK: (1, 2)
3233

33-
func sr11212_content_untupled_pattern_untupled1(u: Untupled) -> (Int, Int) {
34+
func content_untupled_pattern_untupled1(u: Untupled) -> (Int, Int) {
3435
switch u { case .upair(let x, let y): return (x, y) }
3536
}
36-
print(sr11212_content_untupled_pattern_untupled1(u: u_ex))
37+
print(content_untupled_pattern_untupled1(u: u_ex))
3738
// CHECK: (1, 2)
3839

39-
func sr11212_content_untupled_pattern_untupled2(u: Untupled) -> (Int, Int) {
40+
func content_untupled_pattern_untupled2(u: Untupled) -> (Int, Int) {
4041
switch u { case let .upair(x, y): return (x, y) }
4142
}
42-
print(sr11212_content_untupled_pattern_untupled2(u: u_ex))
43+
print(content_untupled_pattern_untupled2(u: u_ex))
4344
// CHECK: (1, 2)
4445

45-
func sr11212_content_untupled_pattern_ambiguous1(u: Untupled) -> (Int, Int) {
46+
func content_untupled_pattern_ambiguous1(u: Untupled) -> (Int, Int) {
4647
switch u { case .upair(let u_): return u_ }
4748
}
48-
print(sr11212_content_untupled_pattern_ambiguous1(u: u_ex))
49+
print(content_untupled_pattern_ambiguous1(u: u_ex))
4950
// CHECK: (1, 2)
5051

51-
func sr11212_content_untupled_pattern_ambiguous2(u: Untupled) -> (Int, Int) {
52+
func content_untupled_pattern_ambiguous2(u: Untupled) -> (Int, Int) {
5253
switch u { case let .upair(u_): return u_ }
5354
}
54-
print(sr11212_content_untupled_pattern_ambiguous2(u: u_ex))
55+
print(content_untupled_pattern_ambiguous2(u: u_ex))
5556
// CHECK: (1, 2)
5657

5758
enum Tupled {
@@ -60,46 +61,46 @@ enum Tupled {
6061

6162
let t_ex = Tupled.tpair((1, 2))
6263

63-
func sr11212_content_tupled_pattern_tupled1(t: Tupled) -> (Int, Int) {
64+
func content_tupled_pattern_tupled1(t: Tupled) -> (Int, Int) {
6465
switch t { case .tpair((let x, let y)): return (x, y) }
6566
}
66-
print(sr11212_content_tupled_pattern_tupled1(t: t_ex))
67+
print(content_tupled_pattern_tupled1(t: t_ex))
6768
// CHECK: (1, 2)
6869

69-
func sr11212_content_tupled_pattern_tupled2(t: Tupled) -> (Int, Int) {
70+
func content_tupled_pattern_tupled2(t: Tupled) -> (Int, Int) {
7071
switch t { case .tpair(let (x, y)): return (x, y) }
7172
}
72-
print(sr11212_content_tupled_pattern_tupled2(t: t_ex))
73+
print(content_tupled_pattern_tupled2(t: t_ex))
7374
// CHECK: (1, 2)
7475

75-
func sr11212_content_tupled_pattern_tupled3(t: Tupled) -> (Int, Int) {
76+
func content_tupled_pattern_tupled3(t: Tupled) -> (Int, Int) {
7677
switch t { case let .tpair((x, y)): return (x, y) }
7778
}
78-
print(sr11212_content_tupled_pattern_tupled3(t: t_ex))
79+
print(content_tupled_pattern_tupled3(t: t_ex))
7980
// CHECK: (1, 2)
8081

81-
func sr11212_content_tupled_pattern_untupled1(t: Tupled) -> (Int, Int) {
82+
func content_tupled_pattern_untupled1(t: Tupled) -> (Int, Int) {
8283
switch t { case .tpair(let x, let y): return (x, y) }
8384
}
84-
print(sr11212_content_tupled_pattern_untupled1(t: t_ex))
85+
print(content_tupled_pattern_untupled1(t: t_ex))
8586
// CHECK: (1, 2)
8687

87-
func sr11212_content_tupled_pattern_untupled2(t: Tupled) -> (Int, Int) {
88+
func content_tupled_pattern_untupled2(t: Tupled) -> (Int, Int) {
8889
switch t { case let .tpair(x, y): return (x, y) }
8990
}
90-
print(sr11212_content_tupled_pattern_untupled2(t: t_ex))
91+
print(content_tupled_pattern_untupled2(t: t_ex))
9192
// CHECK: (1, 2)
9293

93-
func sr11212_content_tupled_pattern_ambiguous1(t: Tupled) -> (Int, Int) {
94+
func content_tupled_pattern_ambiguous1(t: Tupled) -> (Int, Int) {
9495
switch t { case .tpair(let t_): return t_ }
9596
}
96-
print(sr11212_content_tupled_pattern_ambiguous1(t: t_ex))
97+
print(content_tupled_pattern_ambiguous1(t: t_ex))
9798
// CHECK: (1, 2)
9899

99-
func sr11212_content_tupled_pattern_ambiguous2(t: Tupled) -> (Int, Int) {
100+
func content_tupled_pattern_ambiguous2(t: Tupled) -> (Int, Int) {
100101
switch t { case let .tpair(t_): return t_ }
101102
}
102-
print(sr11212_content_tupled_pattern_ambiguous2(t: t_ex))
103+
print(content_tupled_pattern_ambiguous2(t: t_ex))
103104
// CHECK: (1, 2)
104105

105106
enum Box<T> {
@@ -108,44 +109,44 @@ enum Box<T> {
108109

109110
let b_ex : Box<(Int, Int)> = Box.box((1, 2))
110111

111-
func sr11212_content_generic_pattern_tupled1(b: Box<(Int, Int)>) -> (Int, Int) {
112+
func content_generic_pattern_tupled1(b: Box<(Int, Int)>) -> (Int, Int) {
112113
switch b { case .box((let x, let y)): return (x, y) }
113114
}
114-
print(sr11212_content_generic_pattern_tupled1(b: b_ex))
115+
print(content_generic_pattern_tupled1(b: b_ex))
115116
// CHECK: (1, 2)
116117

117-
func sr11212_content_generic_pattern_tupled2(b: Box<(Int, Int)>) -> (Int, Int) {
118+
func content_generic_pattern_tupled2(b: Box<(Int, Int)>) -> (Int, Int) {
118119
switch b { case .box(let (x, y)): return (x, y) }
119120
}
120-
print(sr11212_content_generic_pattern_tupled2(b: b_ex))
121+
print(content_generic_pattern_tupled2(b: b_ex))
121122
// CHECK: (1, 2)
122123

123-
func sr11212_content_generic_pattern_tupled3(b: Box<(Int, Int)>) -> (Int, Int) {
124+
func content_generic_pattern_tupled3(b: Box<(Int, Int)>) -> (Int, Int) {
124125
switch b { case let .box((x, y)): return (x, y) }
125126
}
126-
print(sr11212_content_generic_pattern_tupled3(b: b_ex))
127+
print(content_generic_pattern_tupled3(b: b_ex))
127128
// CHECK: (1, 2)
128129

129-
func sr11212_content_generic_pattern_untupled1(b: Box<(Int, Int)>) -> (Int, Int) {
130+
func content_generic_pattern_untupled1(b: Box<(Int, Int)>) -> (Int, Int) {
130131
switch b { case .box(let x, let y): return (x, y) }
131132
}
132-
print(sr11212_content_generic_pattern_untupled1(b: b_ex))
133+
print(content_generic_pattern_untupled1(b: b_ex))
133134
// CHECK: (1, 2)
134135

135-
func sr11212_content_generic_pattern_untupled2(b: Box<(Int, Int)>) -> (Int, Int) {
136+
func content_generic_pattern_untupled2(b: Box<(Int, Int)>) -> (Int, Int) {
136137
switch b { case let .box(x, y): return (x, y) }
137138
}
138-
print(sr11212_content_generic_pattern_untupled2(b: b_ex))
139+
print(content_generic_pattern_untupled2(b: b_ex))
139140
// CHECK: (1, 2)
140141

141-
func sr11212_content_generic_pattern_ambiguous1(b: Box<(Int, Int)>) -> (Int, Int) {
142+
func content_generic_pattern_ambiguous1(b: Box<(Int, Int)>) -> (Int, Int) {
142143
switch b { case .box(let b_): return b_ }
143144
}
144-
print(sr11212_content_generic_pattern_ambiguous1(b: b_ex))
145+
print(content_generic_pattern_ambiguous1(b: b_ex))
145146
// CHECK: (1, 2)
146147

147-
func sr11212_content_generic_pattern_ambiguous2(b: Box<(Int, Int)>) -> (Int, Int) {
148+
func content_generic_pattern_ambiguous2(b: Box<(Int, Int)>) -> (Int, Int) {
148149
switch b { case let .box(b_): return b_ }
149150
}
150-
print(sr11212_content_generic_pattern_ambiguous2(b: b_ex))
151+
print(content_generic_pattern_ambiguous2(b: b_ex))
151152
// CHECK: (1, 2)

test/Compatibility/self.swift

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

3-
// SR-695
4-
// in version 4 and earlier all of these should build with no diagnostic
3+
// https://github.com/apple/swift/issues/43310
4+
// In version 4 and earlier all of these should build with no diagnostic.
55
class Mario {
66
func getFriend() -> Self { return self }
77
func getEnemy() -> Mario { return self }

test/Compatibility/special_case_name.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %target-typecheck-verify-swift -swift-version 4
22

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

55
enum DayOfTheWeek : Int {
66
case monday = 0

test/Compatibility/tuple_arguments_4.swift

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

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

55
// FIXME: Can't overload local functions so these must be top-level
66
func takePairOverload(_ pair: (Int, Int?)) {}
@@ -18,7 +18,7 @@ do {
1818
// expected-error@-1 {{contextual closure type '(Int, Int?) -> ()' expects 2 arguments, but 1 was used in closure body}}
1919
}
2020

21-
// https://bugs.swift.org/browse/SR-6796
21+
// https://github.com/apple/swift/issues/49345
2222
do {
2323
func f(a: (() -> Void)? = nil) {}
2424
func log<T>() -> ((T) -> Void)? { return nil }

0 commit comments

Comments
 (0)