Closed calda closed 3 years ago
In this example, the redundantReturn rule unexpectedly removed the return keyword in the catch block, which causes the build to fail.
redundantReturn
return
catch
private func method() { let foo: String do { foo = try failableMethod() } catch Feature.error { print("Handled specific error") return } catch { print("Handled general error") return } print(foo) }
swiftformat . --rules redundantReturn
This no longer compiles:
private func method() { let foo: String do { foo = try failableMethod() } catch Feature.error { print("Handled specific error") } catch { print("Handled general error") return } print(foo) }
@calda fixed in 0.48.1
In this example, the
redundantReturn
rule unexpectedly removed thereturn
keyword in thecatch
block, which causes the build to fail.Before
After running
swiftformat . --rules redundantReturn
This no longer compiles: