Closed lhunath closed 2 years ago
Wrapping the subscript operation avoids the issue:
guard let y: Y = ([
.a: .a,
.b: .b,
][x] ?? nil)
else { return nil }
Looks like a duplicate of https://github.com/nicklockwood/SwiftFormat/issues/1095
@lhunath fixed in 0.49.2
hubstaff@Ganymede ios $ swiftformat --version
0.49.2
hubstaff@Ganymede ios $ swiftformat -v Sources/test.swift
Running SwiftFormat...
Reading config file at /Users/hubstaff/workspace/hubstaff/ios/.swiftformat
Formatting /Users/hubstaff/workspace/hubstaff/ios/Sources/test.swift
-- error: Expected { on line 13
error: 1 file could not be formatted.
SwiftFormat configuration: http://ix.io/3MGA
test.swift
is the input file as specified in the issue description.
Input file:
Testing: