Skip to content

DotLambda underscore cannot have space after unit #3364

@nojaf

Description

@nojaf

Issue created from fantomas-online

Code

"yow" |> _.Substring(0, 16).ToLower()

Result

"yow" |> _.Substring(0, 16).ToLower()

Problem description

Code broke:

  "yow" |> _.Substring(0, 16).ToLower ();;
  ---------^^^^^^^^^^^^^^^^^^^^^^^^^^

/Users/nojaf/Projects/stdin(1,10): error FS3584: Shorthand lambda syntax is only supported for atomic expressions, such as method, property, field or indexer on the implied '_' argument. For example: 'let f = _.Length'.

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 2026-04-27T09:49:00Z - 1277944

    { config with
                SpaceBeforeUppercaseInvocation = true }

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.

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