Open
Description
Previous ID | SR-14529 |
Radar | None |
Original Reporter | afannin (JIRA User) |
Type | Bug |
Additional Detail from JIRA
Votes | 0 |
Component/s | swift-format |
Labels | Bug |
Assignee | None |
Priority | Medium |
md5: 7cb3c42b9551dc52aa2896c609bb2f3e
Issue Description:
Adding // swift-format-ignore inside a case in a switch statement causes the linter to crash with the following message:
Fatal error: At least one .break(.open) was not matched by a .break(.close): file SwiftFormatPrettyPrint/PrettyPrint.swift, line 689
Example code that causes the crash is below (running swift-format -r -m lint .):
class Test {
enum FooBar: String {
case foo
case bar
}
func myFunc(_ val: FooBar) {
switch val {
case .foo:
// swift-format-ignore
print("Foo")
case .bar:
print("Bar")
}
}
}