You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Tests/SwiftParserTest/translated/AvailabilityQueryUnavailabilityTests.swift
+5-21Lines changed: 5 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -127,7 +127,6 @@ final class AvailabilityQueryUnavailabilityTests: XCTestCase {
127
127
}
128
128
""",
129
129
diagnostics:[
130
-
// TODO: Old parser expected error on line 1: expected version number
131
130
DiagnosticSpec(
132
131
message:"expected ')' to end availability condition",
133
132
notes:[
@@ -143,10 +142,7 @@ final class AvailabilityQueryUnavailabilityTests: XCTestCase {
143
142
"""
144
143
if #unavailable(OSX) {
145
144
}
146
-
""",
147
-
diagnostics:[
148
-
// TODO: Old parser expected error on line 1: expected version number
149
-
]
145
+
"""
150
146
)
151
147
}
152
148
@@ -321,7 +317,6 @@ final class AvailabilityQueryUnavailabilityTests: XCTestCase {
321
317
}
322
318
""",
323
319
diagnostics:[
324
-
// TODO: Old parser expected error on line 1: expected version number
325
320
DiagnosticSpec(
326
321
message:"expected ')' to end availability condition",
327
322
notes:[
@@ -346,10 +341,7 @@ final class AvailabilityQueryUnavailabilityTests: XCTestCase {
346
341
"""
347
342
if #unavailable(iDishwasherOS 10.51, OSX 10.51) {
348
343
}
349
-
""",
350
-
diagnostics:[
351
-
// TODO: Old parser expected warning on line 1: unrecognized platform name 'iDishwasherOS'
352
-
]
344
+
"""
353
345
)
354
346
}
355
347
@@ -373,7 +365,7 @@ final class AvailabilityQueryUnavailabilityTests: XCTestCase {
373
365
}
374
366
""",
375
367
diagnostics:[
376
-
// TODO: Old parser expected error on line 2: version comparison not needed, Fix-It replacements: 21 - 24 = ''
368
+
// TODO: (good first issue) Old parser expected error on line 2: version comparison not needed, Fix-It replacements: 21 - 24 = ''
377
369
DiagnosticSpec(message:"unexpected code '>= 10.51' in availability condition")
378
370
]
379
371
)
@@ -424,15 +416,7 @@ final class AvailabilityQueryUnavailabilityTests: XCTestCase {
424
416
}
425
417
if #available(macOS 10.51, *), case 42 = 42, #unavailable(macOS 10.52) {
426
418
}
427
-
""",
428
-
diagnostics:[
429
-
// TODO: Old parser expected error on line 2: #available and #unavailable cannot be in the same statement
430
-
// TODO: Old parser expected error on line 4: #available and #unavailable cannot be in the same statement
431
-
// TODO: Old parser expected error on line 6: #available and #unavailable cannot be in the same statement
432
-
// TODO: Old parser expected error on line 8: #available and #unavailable cannot be in the same statement
433
-
// TODO: Old parser expected error on line 10: #available and #unavailable cannot be in the same statement
434
-
// TODO: Old parser expected error on line 12: #available and #unavailable cannot be in the same statement
435
-
]
419
+
"""
436
420
)
437
421
}
438
422
@@ -458,7 +442,7 @@ final class AvailabilityQueryUnavailabilityTests: XCTestCase {
458
442
}
459
443
""",
460
444
diagnostics:[
461
-
// TODO: Old parser expected error on line 2: #available cannot be used as an expression, did you mean to use '#unavailable'?, Fix-It replacements: 4 - 14 = '#unavailable', 18 - 27 = ''
445
+
// TODO: (good first issue) Old parser expected error on line 2: #available cannot be used as an expression, did you mean to use '#unavailable'?, Fix-It replacements: 4 - 14 = '#unavailable', 18 - 27 = ''
462
446
DiagnosticSpec(message:"unexpected code '== false' in 'if' statement")
func f5<T>(x: T) where T : Equatable {} // no-warning
48
-
""",
49
-
diagnostics:[
50
-
// TODO: Old parser expected error on line 5: 'where' clause next to generic parameters is obsolete, Fix-It replacements: 10 - 30 = '', 37 - 37 = ' where T: Womparable'
51
-
]
50
+
"""
52
51
)
53
52
}
54
53
@@ -68,12 +67,7 @@ final class DeprecatedWhereTests: XCTestCase {
68
67
func f24<T where T: Womparable>(x: T) where T: Equatable {}
69
68
// 3,4
70
69
func f34<T>(x: T) -> Int where T: Equatable { return 2 } // no-warning
71
-
""",
72
-
diagnostics:[
73
-
// TODO: Old parser expected error on line 3: 'where' clause next to generic parameters is obsolete, Fix-It replacements: 21 - 41 = '', 48 - 48 = ' where T: Womparable'
74
-
// TODO: Old parser expected error on line 9: 'where' clause next to generic parameters is obsolete, Fix-It replacements: 11 - 31 = '', 45 - 45 = ' where T: Womparable'
75
-
// TODO: Old parser expected error on line 11: 'where' clause next to generic parameters is obsolete, Fix-It replacements: 11 - 31 = '', 39 - 44 = 'where T: Womparable,'
76
-
]
70
+
"""
77
71
)
78
72
}
79
73
@@ -87,12 +81,7 @@ final class DeprecatedWhereTests: XCTestCase {
87
81
func f124<T: Mashable where T: Womparable>(x: T) where T: Equatable {}
88
82
// 2,3,4
89
83
func f234<T where T: Womparable>(x: T) -> Int where T: Equatable { return 2 }
90
-
""",
91
-
diagnostics:[
92
-
// TODO: Old parser expected error on line 3: 'where' clause next to generic parameters is obsolete, Fix-It replacements: 22 - 42 = '', 56 - 56 = ' where T: Womparable'
93
-
// TODO: Old parser expected error on line 5: 'where' clause next to generic parameters is obsolete, Fix-It replacements: 22 - 42 = '', 50 - 55 = 'where T: Womparable,'
94
-
// TODO: Old parser expected error on line 7: 'where' clause next to generic parameters is obsolete, Fix-It replacements: 12 - 32 = '', 47 - 52 = 'where T: Womparable,'
95
-
]
84
+
"""
96
85
)
97
86
}
98
87
@@ -102,10 +91,7 @@ final class DeprecatedWhereTests: XCTestCase {
102
91
// FuncDecl: Choose 4
103
92
// 1,2,3,4
104
93
func f1234<T: Mashable where T: Womparable>(x: T) -> Int where T: Equatable { return 2 }
105
-
""",
106
-
diagnostics:[
107
-
// TODO: Old parser expected error on line 3: 'where' clause next to generic parameters is obsolete, Fix-It replacements: 23 - 43 = '', 58 - 63 = 'where T: Womparable,'
108
-
]
94
+
"""
109
95
)
110
96
}
111
97
@@ -128,10 +114,7 @@ final class DeprecatedWhereTests: XCTestCase {
128
114
struct S2<T where T: Womparable> {}
129
115
// 3: Trailing where
130
116
struct S3<T> where T : Equatable {} // no-warning
131
-
""",
132
-
diagnostics:[
133
-
// TODO: Old parser expected error on line 5: 'where' clause next to generic parameters is obsolete, Fix-It replacements: 12 - 32 = '', 33 - 33 = ' where T: Womparable'
134
-
]
117
+
"""
135
118
)
136
119
}
137
120
@@ -145,11 +128,7 @@ final class DeprecatedWhereTests: XCTestCase {
145
128
struct S13<T: Mashable> where T: Equatable {} // no-warning
146
129
// 2,3
147
130
struct S23<T where T: Womparable> where T: Equatable {}
148
-
""",
149
-
diagnostics:[
150
-
// TODO: Old parser expected error on line 3: 'where' clause next to generic parameters is obsolete, Fix-It replacements: 23 - 43 = '', 44 - 44 = ' where T: Womparable'
151
-
// TODO: Old parser expected error on line 7: 'where' clause next to generic parameters is obsolete, Fix-It replacements: 13 - 33 = '', 35 - 40 = 'where T: Womparable,'
152
-
]
131
+
"""
153
132
)
154
133
}
155
134
@@ -159,10 +138,7 @@ final class DeprecatedWhereTests: XCTestCase {
159
138
// NominalTypeDecl: Choose 3
160
139
// 1,2,3
161
140
struct S123<T: Mashable where T: Womparable> where T: Equatable {}
162
-
""",
163
-
diagnostics:[
164
-
// TODO: Old parser expected error on line 3: 'where' clause next to generic parameters is obsolete, Fix-It replacements: 24 - 44 = '', 46 - 51 = 'where T: Womparable,'
165
-
]
141
+
"""
166
142
)
167
143
}
168
144
@@ -175,11 +151,7 @@ final class DeprecatedWhereTests: XCTestCase {
175
151
protocol ProtoD {}
176
152
func testCombinedConstraints<T: ProtoA & ProtoB where T: ProtoC>(x: T) {}
177
153
func testCombinedConstraints<T: ProtoA & ProtoB where T: ProtoC>(x: T) where T: ProtoD {}
178
-
""",
179
-
diagnostics:[
180
-
// TODO: Old parser expected error on line 5: 'where' clause next to generic parameters is obsolete, Fix-It replacements: 48 - 64 = '', 71 - 71 = ' where T: ProtoC'
181
-
// TODO: Old parser expected error on line 6: 'where' clause next to generic parameters is obsolete, Fix-It replacements: 48 - 64 = '', 72 - 77 = 'where T: ProtoC,'
182
-
]
154
+
"""
183
155
)
184
156
}
185
157
@@ -189,8 +161,6 @@ final class DeprecatedWhereTests: XCTestCase {
189
161
func testCombinedConstraintsOld<T: 2️⃣protocol3️⃣<ProtoA, ProtoB> where T: ProtoC4️⃣>(x: T) {}
190
162
""",
191
163
diagnostics:[
192
-
// TODO: Old parser expected error on line 1: 'where' clause next to generic parameters is obsolete, Fix-It replacements: 60 - 76 = '', 83 - 83 = ' where T: ProtoC'
193
-
// TODO: Old parser expected error on line 1: 'protocol<...>' composition syntax has been removed
194
164
DiagnosticSpec(locationMarker:"2️⃣", message:"expected inherited type in generic parameter"),
195
165
DiagnosticSpec(locationMarker:"2️⃣", message:"expected '>' to end generic parameter clause"),
196
166
DiagnosticSpec(locationMarker:"2️⃣", message:"expected parameter clause in function signature"),
@@ -206,8 +176,6 @@ final class DeprecatedWhereTests: XCTestCase {
206
176
func testCombinedConstraintsOld<T: 2️⃣protocol3️⃣<ProtoA, ProtoB> where T: ProtoC4️⃣>(x: T) where T: ProtoD {}
207
177
""",
208
178
diagnostics:[
209
-
// TODO: Old parser expected error on line 1: 'where' clause next to generic parameters is obsolete, Fix-It replacements: 60 - 76 = '', 84 - 89 = 'where T: ProtoC,'
210
-
// TODO: Old parser expected error on line 1: 'protocol<...>' composition syntax has been removed
211
179
DiagnosticSpec(locationMarker:"2️⃣", message:"expected inherited type in generic parameter"),
212
180
DiagnosticSpec(locationMarker:"2️⃣", message:"expected '>' to end generic parameter clause"),
213
181
DiagnosticSpec(locationMarker:"2️⃣", message:"expected parameter clause in function signature"),
Copy file name to clipboardExpand all lines: Tests/SwiftParserTest/translated/DiagnoseAvailabilityTests.swift
+11-48Lines changed: 11 additions & 48 deletions
Original file line number
Diff line number
Diff line change
@@ -47,12 +47,7 @@ final class DiagnoseAvailabilityTests: XCTestCase {
47
47
"""
48
48
@available(OSX 10.0, deprecated: 10.12)
49
49
func shorthandFollowedByDeprecated() {}
50
-
""",
51
-
diagnostics:[
52
-
// TODO: Old parser expected error on line 1: 'deprecated' can't be combined with shorthand specification 'OSX 10.0'
53
-
// TODO: Old parser expected note on line 1: did you mean to specify an introduction version?, Fix-It replacements: 15 - 15 = ', introduced:'
54
-
// TODO: Old parser expected error on line 1: expected declaration
55
-
]
50
+
"""
56
51
)
57
52
}
58
53
@@ -61,11 +56,7 @@ final class DiagnoseAvailabilityTests: XCTestCase {
61
56
"""
62
57
@available(OSX 10.0, introduced: 10.12)
63
58
func shorthandFollowedByIntroduced() {}
64
-
""",
65
-
diagnostics:[
66
-
// TODO: Old parser expected error on line 1: 'introduced' can't be combined with shorthand specification 'OSX 10.0'
67
-
// TODO: Old parser expected error on line 1: expected declaration
68
-
]
59
+
"""
69
60
)
70
61
}
71
62
@@ -83,11 +74,7 @@ final class DiagnoseAvailabilityTests: XCTestCase {
83
74
"""
84
75
@available(iOS 6.0, OSX 10.0, deprecated: 10.12)
85
76
func twoShorthandsFollowedByDeprecated() {}
86
-
""",
87
-
diagnostics:[
88
-
// TODO: Old parser expected error on line 1: 'deprecated' can't be combined with shorthand specification 'OSX 10.0'
89
-
// TODO: Old parser expected error on line 1: expected declaration
90
-
]
77
+
"""
91
78
)
92
79
}
93
80
@@ -105,10 +92,7 @@ final class DiagnoseAvailabilityTests: XCTestCase {
105
92
"""
106
93
@available(*, deprecated: 4.2)
107
94
func allPlatformsDeprecatedVersion() {}
108
-
""",
109
-
diagnostics:[
110
-
// TODO: Old parser expected warning on line 1: unexpected version number in 'available' attribute for non-specific platform '*', Fix-It replacements: 25 - 30 = ''
111
-
]
95
+
"""
112
96
)
113
97
}
114
98
@@ -117,10 +101,7 @@ final class DiagnoseAvailabilityTests: XCTestCase {
117
101
"""
118
102
@available(*, deprecated, obsoleted: 4.2)
119
103
func allPlatformsDeprecatedAndObsoleted() {}
120
-
""",
121
-
diagnostics:[
122
-
// TODO: Old parser expected warning on line 1: unexpected version number in 'available' attribute for non-specific platform '*', Fix-It replacements: 36 - 41 = ''
123
-
]
104
+
"""
124
105
)
125
106
}
126
107
@@ -129,10 +110,7 @@ final class DiagnoseAvailabilityTests: XCTestCase {
0 commit comments