File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
Tests/SwiftParserTest/translated Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -391,6 +391,17 @@ final class InitDeinitTests: XCTestCase {
391
391
)
392
392
}
393
393
394
+ func testInitDeinit28( ) {
395
+ AssertParse (
396
+ """
397
+ init(_ foo: T) 1️⃣-> Int where T: Comparable {}
398
+ """ ,
399
+ diagnostics: [
400
+ DiagnosticSpec ( message: " initializers cannot have a result type " )
401
+ ]
402
+ )
403
+ }
404
+
394
405
func testDeinitInSwiftinterfaceIsFollowedByFinalFunc( ) {
395
406
AssertParse (
396
407
"""
Original file line number Diff line number Diff line change @@ -1742,7 +1742,7 @@ final class RecoveryTests: XCTestCase {
1742
1742
DiagnosticSpec ( message: " initializers cannot have a name " , fixIts: [ " remove 'a' " ] )
1743
1743
] ,
1744
1744
fixedSource: """
1745
- init (b: Int) {}
1745
+ init(b: Int) {}
1746
1746
"""
1747
1747
)
1748
1748
}
@@ -1756,7 +1756,7 @@ final class RecoveryTests: XCTestCase {
1756
1756
DiagnosticSpec ( message: " initializers cannot have a name " , fixIts: [ " remove 'c' " ] )
1757
1757
] ,
1758
1758
fixedSource: """
1759
- init? (_ d: Int) {}
1759
+ init?(_ d: Int) {}
1760
1760
"""
1761
1761
)
1762
1762
}
@@ -1770,7 +1770,7 @@ final class RecoveryTests: XCTestCase {
1770
1770
DiagnosticSpec ( message: " initializers cannot have a name " , fixIts: [ " remove 'e<T>' " ] )
1771
1771
] ,
1772
1772
fixedSource: """
1773
- init (f: T) {}
1773
+ init(f: T) {}
1774
1774
"""
1775
1775
)
1776
1776
}
@@ -1784,7 +1784,7 @@ final class RecoveryTests: XCTestCase {
1784
1784
DiagnosticSpec ( message: " initializers cannot have a name " , fixIts: [ " remove 'g<T>' " ] )
1785
1785
] ,
1786
1786
fixedSource: """
1787
- init? (_: T) {}
1787
+ init?(_: T) {}
1788
1788
"""
1789
1789
)
1790
1790
}
You can’t perform that action at this time.
0 commit comments