SwiftFormat icon indicating copy to clipboard operation
SwiftFormat copied to clipboard

redundantVoidReturnType removes returned closure in 0.55.5

Open alanzeino opened this issue 10 months ago • 0 comments

In this example in 0.55.5:

public protocol FooProtocol {
    func foo(bar: Bar) -> () throws -> Void
}

When applying redundantVoidReturnType, it will always return:

public protocol FooProtocol {
    func foo(bar: Bar) -> throws
}

...even when passing --closurevoid preserve. Since the above intends to return a closure, it breaks call sites that expected a closure from foo(bar:).

alanzeino avatar Feb 18 '25 18:02 alanzeino