Skip to content

Lambda in tuple in list on single line changes meaning of code #3278

Closed

Description

@nojaf

Issue created from fantomas-online

Code

module A

let x =
    [
        1, fun () -> 1
        1, fun () -> 1
    ]

Result

module A

let x =
    [
        1,
        fun () ->
            1
            1, fun () -> 1
    ]

Problem description

Please describe here the Fantomas problem you encountered.
Check out our Contribution Guidelines.

Extra information

  • The formatted result breaks my code.
  • The formatted result gives compiler warnings.
  • I or my company would be willing to help fix this.
  • I would like a release if this problem is solved.

Options

Fantomas main branch at 2025-09-08T06:57:30Z - 31029b1

    { config with
                MultilineBracketStyle = aligned }

Did you know that you can ignore files when formatting by using a .fantomasignore file?
PS: It's unlikely that someone else will solve your specific issue, as it's something that you have a personal stake in.

Activity

  1. github-actions commented on Mar 12, 2026

    @github-actions
  2. github-actions commented on Apr 1, 2026

    @github-actions
    Contributor

    Note

    The pull request was not created — a fallback review issue was created instead due to protected file changes: #3326

    🤖 This is an automated response from Repo Assist.

    I've re-investigated this bug on the current main branch (post-PR #3303 lambda refactor). The regression test lambda in tuple in list preserves semantics, 3278 now passes — the bug appears to have been fixed as part of the recent lambda refactor work.

    To verify: formatting the original input produces the correct output (the list remains multiline, preventing the lambda from capturing subsequent elements as sequence expressions).

    This issue can likely be closed. Would the maintainer like to confirm and close it?

    Generated by 🌈 Repo Assist at {run-started}. Learn more.

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/repo-assist.md@1f672aef974f4246124860fc532f82fe8a93a57e
    
  3. nojaf commented on Apr 1, 2026

    @nojaf
    ContributorAuthor

    Closed by #3303

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions