Skip to content

Commit 0d73e89

Browse files
committed
Update testcases
1 parent c1e5981 commit 0d73e89

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

Tests/SwiftParserTest/translated/InitDeinitTests.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff 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
"""

Tests/SwiftParserTest/translated/RecoveryTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)