Skip to content

Incorrect line split when using a custom operator #2107

@chausner

Description

@chausner

Issue created from fantomas-online

Code

let inline (%%) x y = ((x % y) + y) % y

let aVeryLongVariableName = 0

let a = (if aVeryLongVariableName = 0 then 1 else -1) %% 4

Result

let inline (%%) x y = ((x % y) + y) % y

let aVeryLongVariableName = 0

let a =
    (if aVeryLongVariableName = 0 then
         1
     else
         -1)

    %% 4

Problem description

Fantomas incorrectly moves the custom %% operator to a new line which makes the code not compile anymore.

Extra information

  • The formatted result breaks by code.
  • The formatted result gives compiler warnings.
  • I or my company would be willing to help fix this.

Options

Fantomas master branch at 1/1/1990

Default Fantomas configuration

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions