mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
c9c9000b20
When a CallExpr's callee is implicit (e.g. `callAsFunction`), `fn->getEndLoc()` collapses to the call site's location, so the bare-trailing-closure path could compute `lastLoc` at or past the closure's start. The resulting `fixItReplaceChars(lastLoc, closureRange.Start, ...)` produced a degenerate SourceRange that crashed the Swift-syntax-aware diagnostic renderer when constructing `Range<AbsolutePosition>`. Detect that case and fall back to a plain insertion at the closure's start. fixes rdar://170779809