You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using prioritizeKeepingFunctionOutputTogether in release configuration, any init with a parameter is split onto multiple lines, even if it fits within the max line length without line breaks.
Example:
Given this file:
structFoo {
init() {
print("This one is fine")
}
init(a: String) {
print("This one is not")
}
init(a: String, b: String) {
print("This one is not")
}
funcfoo(a: String) {
print("This one is fine")
}
}
When using prioritizeKeepingFunctionOutputTogether, formatting results in the following output:
structFoo {
init() {
print("This one is fine")
}
init(
a: String
) {
print("This one is not")
}
init(
a: String, b: String
) {
print("This one is not")
}
funcfoo(a: String) {
print("This one is fine")
}
}
Note that this only occurs with init, not regular func, as the example shows.
This is potentially related to SR-13049. When I try the above with a debug configuration, swift-format crashes with SwiftFormatPrettyPrint/PrettyPrint.swift:675: Assertion failed: Too many unresolved delmiter token lengths.
The text was updated successfully, but these errors were encountered:
Environment
macOS 11.4 (20F71)
swift-format 0.50400.0, release configuration
Additional Detail from JIRA
md5: c5349ac25845be9c05ee8df8efcf94cd
Issue Description:
When using
prioritizeKeepingFunctionOutputTogether
inrelease
configuration, anyinit
with a parameter is split onto multiple lines, even if it fits within the max line length without line breaks.Example:
Given this file:
When using
prioritizeKeepingFunctionOutputTogether
, formatting results in the following output:Note that this only occurs with
init
, not regularfunc
, as the example shows.This is potentially related to SR-13049. When I try the above with a debug configuration, swift-format crashes with
SwiftFormatPrettyPrint/PrettyPrint.swift:675: Assertion failed: Too many unresolved delmiter token lengths.
The text was updated successfully, but these errors were encountered: