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