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