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/RecoveryTests.swift
+64-13Lines changed: 64 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -1204,22 +1204,63 @@ final class RecoveryTests: XCTestCase {
1204
1204
"""
1205
1205
struct ErrorTypeInVarDeclDictionaryType {
1206
1206
let a1: String1️⃣:
1207
-
let a2: String2️⃣: Int]
1208
-
let a3: String3️⃣: [Int]
1209
-
let a4: String4️⃣: Int
1207
+
let a2: 2️⃣String: Int]
1208
+
let a3: 3️⃣String: [Int]4️⃣
1209
+
let a4: 5️⃣String: Int6️⃣
1210
+
let a4: 7️⃣String: Int]??
1210
1211
}
1211
1212
""",
1212
1213
diagnostics:[
1213
-
// TODO: Old parser expected error on line 2: unexpected ':' in type; did you mean to write a dictionary type?, Fix-It replacements: 11 - 11 = '['
1214
-
DiagnosticSpec(locationMarker:"1️⃣", message:"consecutive declarations on a line must be separated by ';'", fixIts:["insert ';'"]),
1215
-
DiagnosticSpec(locationMarker:"1️⃣", message:"unexpected code ':' before variable"),
1216
-
// TODO: Old parser expected error on line 3: unexpected ':' in type; did you mean to write a dictionary type?, Fix-It replacements: 11 - 11 = '['
1217
-
DiagnosticSpec(locationMarker:"2️⃣", message:"unexpected code ': Int]' before variable"),
1218
-
// TODO: Old parser expected error on line 4: unexpected ':' in type; did you mean to write a dictionary type?, Fix-It replacements: 11 - 11 = '[', 24 - 24 = ']'
1219
-
DiagnosticSpec(locationMarker:"3️⃣", message:"unexpected code ': [Int]' before variable"),
1220
-
// TODO: Old parser expected error on line 5: unexpected ':' in type; did you mean to write a dictionary type?, Fix-It replacements: 11 - 11 = '[', 22 - 22 = ']'
1221
-
DiagnosticSpec(locationMarker:"4️⃣", message:"unexpected code ': Int' in struct"),
1222
-
]
1214
+
DiagnosticSpec(
1215
+
locationMarker:"1️⃣",
1216
+
message:"consecutive declarations on a line must be separated by ';'",
1217
+
fixIts:["insert ';'"]
1218
+
),
1219
+
DiagnosticSpec(
1220
+
locationMarker:"1️⃣",
1221
+
message:"unexpected code ':' before variable"
1222
+
),
1223
+
DiagnosticSpec(
1224
+
locationMarker:"2️⃣",
1225
+
message:"expected '[' to start dictionary type",
1226
+
fixIts:["insert '['"]
1227
+
),
1228
+
DiagnosticSpec(
1229
+
locationMarker:"3️⃣",
1230
+
message:"expected '[' to start dictionary type",
1231
+
fixIts:["insert '['"]
1232
+
),
1233
+
DiagnosticSpec(
1234
+
locationMarker:"4️⃣",
1235
+
message:"expected ']' to end dictionary type",
1236
+
fixIts:["insert ']'"]
1237
+
),
1238
+
DiagnosticSpec(
1239
+
locationMarker:"5️⃣",
1240
+
message:"expected '[' to start dictionary type",
1241
+
fixIts:["insert '['"]
1242
+
),
1243
+
DiagnosticSpec(
1244
+
locationMarker:"6️⃣",
1245
+
message:"expected ']' to end dictionary type",
1246
+
fixIts:["insert ']'"]
1247
+
),
1248
+
DiagnosticSpec(
1249
+
locationMarker:"7️⃣",
1250
+
message:"expected '[' to start dictionary type",
1251
+
fixIts:["insert '['"]
1252
+
),
1253
+
1254
+
],
1255
+
fixedSource:"""
1256
+
struct ErrorTypeInVarDeclDictionaryType {
1257
+
let a1: String;:
1258
+
let a2: [String: Int]
1259
+
let a3: [String: [Int]]
1260
+
let a4: [String: Int]
1261
+
let a4: [String: Int]??
1262
+
}
1263
+
"""
1223
1264
)
1224
1265
}
1225
1266
@@ -2340,4 +2381,14 @@ final class RecoveryTests: XCTestCase {
0 commit comments