@@ -1728,7 +1728,7 @@ final class RecoveryTests: XCTestCase {
1728
1728
DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " expected '>' to end generic parameter clause " ) ,
1729
1729
DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " expected type and ')' to end parameter clause " ) ,
1730
1730
DiagnosticSpec ( locationMarker: " 3️⃣ " , message: " unexpected code ')}' before struct " ) ,
1731
- DiagnosticSpec ( locationMarker: " 4️⃣ " , message: " unexpected code 'x' before parameter clause " ) ,
1731
+ DiagnosticSpec ( locationMarker: " 4️⃣ " , message: " initializers cannot have a name " , fixIts : [ " remove 'x' " ] ) ,
1732
1732
]
1733
1733
)
1734
1734
}
@@ -1739,9 +1739,11 @@ final class RecoveryTests: XCTestCase {
1739
1739
init 1️⃣a(b: Int) {}
1740
1740
""" ,
1741
1741
diagnostics: [
1742
- // TODO: (good first issue) Old parser expected error on line 3: initializers cannot have a name, Fix-It replacements: 8 - 9 = ''
1743
- DiagnosticSpec ( message: " unexpected code 'a' before parameter clause " )
1744
- ]
1742
+ DiagnosticSpec ( message: " initializers cannot have a name " , fixIts: [ " remove 'a' " ] )
1743
+ ] ,
1744
+ fixedSource: """
1745
+ init (b: Int) {}
1746
+ """
1745
1747
)
1746
1748
}
1747
1749
@@ -1751,9 +1753,11 @@ final class RecoveryTests: XCTestCase {
1751
1753
init? 1️⃣c(_ d: Int) {}
1752
1754
""" ,
1753
1755
diagnostics: [
1754
- // TODO: (good first issue) Old parser expected error on line 1: initializers cannot have a name, Fix-It replacements: 9 - 10 = ''
1755
- DiagnosticSpec ( message: " unexpected code 'c' before parameter clause " )
1756
- ]
1756
+ DiagnosticSpec ( message: " initializers cannot have a name " , fixIts: [ " remove 'c' " ] )
1757
+ ] ,
1758
+ fixedSource: """
1759
+ init? (_ d: Int) {}
1760
+ """
1757
1761
)
1758
1762
}
1759
1763
@@ -1763,9 +1767,11 @@ final class RecoveryTests: XCTestCase {
1763
1767
init 1️⃣e<T>(f: T) {}
1764
1768
""" ,
1765
1769
diagnostics: [
1766
- // TODO: (good first issue) Old parser expected error on line 1: initializers cannot have a name, Fix-It replacements: 8 - 9 = ''
1767
- DiagnosticSpec ( message: " unexpected code 'e<T>' before parameter clause " )
1768
- ]
1770
+ DiagnosticSpec ( message: " initializers cannot have a name " , fixIts: [ " remove 'e<T>' " ] )
1771
+ ] ,
1772
+ fixedSource: """
1773
+ init (f: T) {}
1774
+ """
1769
1775
)
1770
1776
}
1771
1777
@@ -1775,9 +1781,11 @@ final class RecoveryTests: XCTestCase {
1775
1781
init? 1️⃣g<T>(_: T) {}
1776
1782
""" ,
1777
1783
diagnostics: [
1778
- // TODO: (good first issue) Old parser expected error on line 1: initializers cannot have a name, Fix-It replacements: 9 - 10 = ''
1779
- DiagnosticSpec ( message: " unexpected code 'g<T>' before parameter clause " )
1780
- ]
1784
+ DiagnosticSpec ( message: " initializers cannot have a name " , fixIts: [ " remove 'g<T>' " ] )
1785
+ ] ,
1786
+ fixedSource: """
1787
+ init? (_: T) {}
1788
+ """
1781
1789
)
1782
1790
}
1783
1791
0 commit comments