nicklockwood / SwiftFormat

A command-line tool and Xcode Extension for formatting Swift code
MIT License
7.92k stars 639 forks source link

Unexpected static keyword #1419

Closed keith closed 1 year ago

keith commented 1 year ago

With this code:

typealias A = ([B], Int)

struct C {
    static func bar() {
        return something
            .do(onSuccess: { result in
                if case .success((let d, _)) = result {
                    self.relay.onNext(d)
                }
            })
    }

    static func foo() {
        fatalError()
    }
}

Running swiftformat foo.swift --rules redundantSelf fails with:

error: Unexpected static keyword on line 13 in

using 0.51.5

nicklockwood commented 1 year ago

@keith fixed in 0.51.6