Closed everlof closed 10 months ago
$ swiftformat --version 0.52.6
This code:
private func constraint() -> [Int] { [ 1, 2, { switch Bool.random() { case true: 3 case false: 4 } }(), ] }
generates this code:
private func constraint() -> [Int] { [ 1, 2, switch Bool.random() { case true: 3 case false: 4 }, ] }
which doesn't compile due to:
file.swift:5:9: error: 'switch' may only be used as expression in return, throw, or as the source of an assignment switch Bool.random() { ^
@calda would you mind taking a look at this one?
@everlof fixed in 0.52.8
Awesome! Thanks!
This code:
generates this code:
which doesn't compile due to: