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
+59-15Lines changed: 59 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -810,6 +810,7 @@ final class RecoveryTests: XCTestCase {
810
810
}
811
811
812
812
func testRecovery63(){
813
+
813
814
assertParse(
814
815
#"""
815
816
struct SS 1️⃣SS : Multi {
@@ -831,7 +832,8 @@ final class RecoveryTests: XCTestCase {
831
832
message:"expected ':' in type annotation",
832
833
fixIts:["insert ':'"]
833
834
),
834
-
DiagnosticSpec(locationMarker:"3️⃣", message:#"unexpected code ': Int = ""' before function"#),
835
+
DiagnosticSpec(
836
+
locationMarker:"3️⃣", message:#"unexpected code ': Int = ""' before function"#),
835
837
DiagnosticSpec(
836
838
locationMarker:"4️⃣",
837
839
message:"expected ':' in type annotation",
@@ -1177,23 +1179,65 @@ final class RecoveryTests: XCTestCase {
1177
1179
assertParse(
1178
1180
"""
1179
1181
struct ErrorTypeInVarDeclDictionaryType {
1180
-
let a1: String1️⃣:
1181
-
let a2: String2️⃣: Int]
1182
-
let a3: String3️⃣: [Int]
1183
-
let a4: String4️⃣: Int
1182
+
let a1: 1️⃣String:2️⃣
1183
+
let a2: 3️⃣String: Int]
1184
+
let a3: 4️⃣String: [Int]5️⃣
1185
+
let a4: 6️⃣String: Int7️⃣
1186
+
let a4: 8️⃣String: Int]??
1184
1187
}
1185
1188
""",
1186
1189
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
-
]
1190
+
DiagnosticSpec(
1191
+
locationMarker:"1️⃣",
1192
+
message:"expected '[' to start dictionary type",
1193
+
fixIts:["insert '['"]
1194
+
),
1195
+
DiagnosticSpec(
1196
+
locationMarker:"2️⃣",
1197
+
message:"expected value type and ']' to end dictionary type",
0 commit comments