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 @@ -1742,7 +1742,7 @@ final class RecoveryTests: XCTestCase {
17421742 DiagnosticSpec ( message: " initializers cannot have a name " , fixIts: [ " remove 'a' " ] )
17431743 ] ,
17441744 fixedSource: """
1745- init (b: Int) {}
1745+ init(b: Int) {}
17461746 """
17471747 )
17481748 }
@@ -1756,7 +1756,7 @@ final class RecoveryTests: XCTestCase {
17561756 DiagnosticSpec ( message: " initializers cannot have a name " , fixIts: [ " remove 'c' " ] )
17571757 ] ,
17581758 fixedSource: """
1759- init? (_ d: Int) {}
1759+ init?(_ d: Int) {}
17601760 """
17611761 )
17621762 }
@@ -1770,7 +1770,7 @@ final class RecoveryTests: XCTestCase {
17701770 DiagnosticSpec ( message: " initializers cannot have a name " , fixIts: [ " remove 'e<T>' " ] )
17711771 ] ,
17721772 fixedSource: """
1773- init (f: T) {}
1773+ init(f: T) {}
17741774 """
17751775 )
17761776 }
@@ -1784,7 +1784,7 @@ final class RecoveryTests: XCTestCase {
17841784 DiagnosticSpec ( message: " initializers cannot have a name " , fixIts: [ " remove 'g<T>' " ] )
17851785 ] ,
17861786 fixedSource: """
1787- init? (_: T) {}
1787+ init?(_: T) {}
17881788 """
17891789 )
17901790 }
You can’t perform that action at this time.
0 commit comments