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
+56-14Lines changed: 56 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -1177,23 +1177,65 @@ final class RecoveryTests: XCTestCase {
1177
1177
assertParse(
1178
1178
"""
1179
1179
struct ErrorTypeInVarDeclDictionaryType {
1180
-
let a1: String1️⃣:
1181
-
let a2: String2️⃣: Int]
1182
-
let a3: String3️⃣: [Int]
1183
-
let a4: String4️⃣: Int
1180
+
let a1: 1️⃣String:2️⃣
1181
+
let a2: 3️⃣String: Int]
1182
+
let a3: 4️⃣String: [Int]5️⃣
1183
+
let a4: 6️⃣String: Int7️⃣
1184
+
let a4: 8️⃣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:"expected '[' to start dictionary type",
1191
+
fixIts:["insert '['"]
1192
+
),
1193
+
DiagnosticSpec(
1194
+
locationMarker:"2️⃣",
1195
+
message:"expected value type and ']' to end dictionary type",
0 commit comments