nicklockwood / SwiftFormat

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

Breaks the code by removing needed parentheses for generic parameter packs #1661

Closed ivanovdmitri closed 2 months ago

ivanovdmitri commented 3 months ago
func f<each V>(_: repeat ((each V).Type, as: (each V) -> String)) {}

the formatter changes this to:

func f<each V>(_: repeat (each V.Type, as: (each V) -> String)) {}

causing a compilation error:

error: 'each' cannot be applied to non-pack type '(each V).Type'
func f<each V>(_: repeat (each V.Type, as: (each V) -> String)) {}
nicklockwood commented 2 months ago

@ivanovdmitri fixed in 0.53.6