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 @@ -1755,7 +1755,7 @@ final class RecoveryTests: XCTestCase {
1755
1755
DiagnosticSpec ( message: " initializers cannot have a name " , fixIts: [ " remove 'a' " ] )
1756
1756
] ,
1757
1757
fixedSource: """
1758
- init (b: Int) {}
1758
+ init(b: Int) {}
1759
1759
"""
1760
1760
)
1761
1761
}
@@ -1769,7 +1769,7 @@ final class RecoveryTests: XCTestCase {
1769
1769
DiagnosticSpec ( message: " initializers cannot have a name " , fixIts: [ " remove 'c' " ] )
1770
1770
] ,
1771
1771
fixedSource: """
1772
- init? (_ d: Int) {}
1772
+ init?(_ d: Int) {}
1773
1773
"""
1774
1774
)
1775
1775
}
@@ -1783,7 +1783,7 @@ final class RecoveryTests: XCTestCase {
1783
1783
DiagnosticSpec ( message: " initializers cannot have a name " , fixIts: [ " remove 'e<T>' " ] )
1784
1784
] ,
1785
1785
fixedSource: """
1786
- init (f: T) {}
1786
+ init(f: T) {}
1787
1787
"""
1788
1788
)
1789
1789
}
@@ -1797,7 +1797,7 @@ final class RecoveryTests: XCTestCase {
1797
1797
DiagnosticSpec ( message: " initializers cannot have a name " , fixIts: [ " remove 'g<T>' " ] )
1798
1798
] ,
1799
1799
fixedSource: """
1800
- init? (_: T) {}
1800
+ init?(_: T) {}
1801
1801
"""
1802
1802
)
1803
1803
}
You can’t perform that action at this time.
0 commit comments