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
@@ -1178,22 +1178,63 @@ final class RecoveryTests: XCTestCase {
1178
1178
"""
1179
1179
struct ErrorTypeInVarDeclDictionaryType {
1180
1180
let a1: String1️⃣:
1181
-
let a2: String2️⃣: Int]
1182
-
let a3: String3️⃣: [Int]
1183
-
let a4: String4️⃣: Int
1181
+
let a2: 2️⃣String: Int]
1182
+
let a3: 3️⃣String: [Int]4️⃣
1183
+
let a4: 5️⃣String: Int6️⃣
1184
+
let a4: 7️⃣String: Int]??
1184
1185
}
1185
1186
""",
1186
1187
diagnostics:[
1187
-
// TODO: Old parser expected error on line 2: unexpected ':' in type; did you mean to write a dictionary type?, Fix-It replacements: 11 - 11 = '['
1188
-
DiagnosticSpec(locationMarker:"1️⃣", message:"consecutive declarations on a line must be separated by ';'", fixIts:["insert ';'"]),
1189
-
DiagnosticSpec(locationMarker:"1️⃣", message:"unexpected code ':' before variable"),
1190
-
// TODO: Old parser expected error on line 3: unexpected ':' in type; did you mean to write a dictionary type?, Fix-It replacements: 11 - 11 = '['
1191
-
DiagnosticSpec(locationMarker:"2️⃣", message:"unexpected code ': Int]' before variable"),
1192
-
// 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 = ']'
1193
-
DiagnosticSpec(locationMarker:"3️⃣", message:"unexpected code ': [Int]' before variable"),
1194
-
// 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 = ']'
1195
-
DiagnosticSpec(locationMarker:"4️⃣", message:"unexpected code ': Int' in struct"),
1196
-
]
1188
+
DiagnosticSpec(
1189
+
locationMarker:"1️⃣",
1190
+
message:"consecutive declarations on a line must be separated by ';'",
1191
+
fixIts:["insert ';'"]
1192
+
),
1193
+
DiagnosticSpec(
1194
+
locationMarker:"1️⃣",
1195
+
message:"unexpected code ':' before variable"
1196
+
),
1197
+
DiagnosticSpec(
1198
+
locationMarker:"2️⃣",
1199
+
message:"expected '[' to start dictionary type",
1200
+
fixIts:["insert '['"]
1201
+
),
1202
+
DiagnosticSpec(
1203
+
locationMarker:"3️⃣",
1204
+
message:"expected '[' to start dictionary type",
1205
+
fixIts:["insert '['"]
1206
+
),
1207
+
DiagnosticSpec(
1208
+
locationMarker:"4️⃣",
1209
+
message:"expected ']' to end dictionary type",
1210
+
fixIts:["insert ']'"]
1211
+
),
1212
+
DiagnosticSpec(
1213
+
locationMarker:"5️⃣",
1214
+
message:"expected '[' to start dictionary type",
1215
+
fixIts:["insert '['"]
1216
+
),
1217
+
DiagnosticSpec(
1218
+
locationMarker:"6️⃣",
1219
+
message:"expected ']' to end dictionary type",
1220
+
fixIts:["insert ']'"]
1221
+
),
1222
+
DiagnosticSpec(
1223
+
locationMarker:"7️⃣",
1224
+
message:"expected '[' to start dictionary type",
1225
+
fixIts:["insert '['"]
1226
+
),
1227
+
1228
+
],
1229
+
fixedSource:"""
1230
+
struct ErrorTypeInVarDeclDictionaryType {
1231
+
let a1: String;:
1232
+
let a2: [String: Int]
1233
+
let a3: [String: [Int]]
1234
+
let a4: [String: Int]
1235
+
let a4: [String: Int]??
1236
+
}
1237
+
"""
1197
1238
)
1198
1239
}
1199
1240
@@ -2314,4 +2355,14 @@ final class RecoveryTests: XCTestCase {
0 commit comments