Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Keep parens around a dangling hole with an alignment
The old guard matched a ':fmt' qualifier only; an alignment hole was protected
by accident, because ',3' was encoded as a tuple in the fill expression and the
tuple rule kept the parens. Lifting the alignment into SynInterpolationFormatting
removed that tuple, so match the alignment here too.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
  • Loading branch information
charlesroddie and claude committed Jul 30, 2026
commit 930d2adc92cdab573a3f505185ba8e31b43cf571
3 changes: 3 additions & 0 deletions src/Compiler/Service/SynExpr.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1087,9 +1087,12 @@ module SynExpr =
| SynExpr.InterpolatedString _, SynExpr.Sequential _
| SynExpr.InterpolatedString _, SynExpr.Tuple(isStruct = false) -> true

// Removing the parens would let a trailing alignment or format be parsed as part of the hole,
// e.g. the ',-3' in '$"{(if b then 1 else 0),-3}"' becoming a tuple in the else branch.
| SynExpr.InterpolatedString(contents = contents), Dangling.Problematic _ ->
contents
|> List.exists (function
| SynInterpolatedStringPart.FillExpr(formatting = SynInterpolationFormatting.DotNet(alignment = Some _))
| SynInterpolatedStringPart.FillExpr(formatting = SynInterpolationFormatting.DotNet(format = Some _)) -> true
Comment thread
abonie marked this conversation as resolved.
Resolved
| _ -> false)

Expand Down