swiftlang / swift-format

Formatting technology for Swift source code
Apache License 2.0
2.45k stars 224 forks source link

[SR-13049] prioritizeKeepingFunctionOutputTogether → Assertion failed: Too many unresolved delimiter token lengths. #319

Open swift-ci opened 4 years ago

swift-ci commented 4 years ago
Previous ID SR-13049
Radar None
Original Reporter SDGGiesbrecht (JIRA User)
Type Bug
Environment macOS 10.15 Swift 5.2.4 swift-format 0.50200.1 (`--configuration debug`)
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 1 | |Component/s | swift-format | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 03dbcc7fa590f6df220907a3ac3b2572

Issue Description:

Formatting with `prioritizeKeepingFunctionOutputTogether` engaged can lead to assertion failures.

This code is enough to trip it:

init(a: B) {}

typesanitizer commented 4 years ago

cc @allevato

pdesjardins90 commented 2 years ago

I get this error too even when setting:

prioritizeKeepingFunctionOutputTogether: false

using swift 5.5.2 + swift-format 0.50500.0 on ubuntu

EDIT:

Found a different culprit:
rules: { BeginDocumentationCommentWithOneLineSummary: true }

MrJackScratch commented 1 year ago

Just got this error as well, prioritizeKeepingFunctionOutputTogether was the culprit.

ahoppen commented 4 months ago

Tracked in Apple’s issue tracker as rdar://126948255