nicklockwood / SwiftFormat

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

"error: Expected for keyword" on 0.51.11 #1466

Closed fischman-bcny closed 1 year ago

fischman-bcny commented 1 year ago

Looks a lot like #1386 but still happens in 0.51.11:

/tmp $ cat x.swift
func f() {
    let str = "hello"
    try! str.withCString(encodedAs: UTF8.self) { _ throws in
        try! str.withCString(encodedAs: UTF8.self) { _ throws in }
    }
}

/tmp $ swiftformat --swiftversion 5.7 x.swift
Running SwiftFormat...
error: Expected for keyword on line 4 in /tmp/x.swift.

/tmp $ swiftformat --version
0.51.11

(no .swiftformat file in the mix)

nicklockwood commented 1 year ago

@fischman-bcny fixed in 0.51.12