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 {
391391 )
392392 }
393393
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+
394405 func testDeinitInSwiftinterfaceIsFollowedByFinalFunc( ) {
395406 AssertParse (
396407 """
Original file line number Diff line number Diff line change @@ -1755,7 +1755,7 @@ final class RecoveryTests: XCTestCase {
17551755 DiagnosticSpec ( message: " initializers cannot have a name " , fixIts: [ " remove 'a' " ] )
17561756 ] ,
17571757 fixedSource: """
1758- init (b: Int) {}
1758+ init(b: Int) {}
17591759 """
17601760 )
17611761 }
@@ -1769,7 +1769,7 @@ final class RecoveryTests: XCTestCase {
17691769 DiagnosticSpec ( message: " initializers cannot have a name " , fixIts: [ " remove 'c' " ] )
17701770 ] ,
17711771 fixedSource: """
1772- init? (_ d: Int) {}
1772+ init?(_ d: Int) {}
17731773 """
17741774 )
17751775 }
@@ -1783,7 +1783,7 @@ final class RecoveryTests: XCTestCase {
17831783 DiagnosticSpec ( message: " initializers cannot have a name " , fixIts: [ " remove 'e<T>' " ] )
17841784 ] ,
17851785 fixedSource: """
1786- init (f: T) {}
1786+ init(f: T) {}
17871787 """
17881788 )
17891789 }
@@ -1797,7 +1797,7 @@ final class RecoveryTests: XCTestCase {
17971797 DiagnosticSpec ( message: " initializers cannot have a name " , fixIts: [ " remove 'g<T>' " ] )
17981798 ] ,
17991799 fixedSource: """
1800- init? (_: T) {}
1800+ init?(_: T) {}
18011801 """
18021802 )
18031803 }
You can’t perform that action at this time.
0 commit comments