Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concatenation of lines can break operator precedence #942

Closed
1 of 3 tasks
Smaug123 opened this issue Jul 2, 2020 · 0 comments · Fixed by #959
Closed
1 of 3 tasks

Concatenation of lines can break operator precedence #942

Smaug123 opened this issue Jul 2, 2020 · 0 comments · Fixed by #959

Comments

@Smaug123
Copy link
Contributor

Smaug123 commented Jul 2, 2020

Issue created from fantomas-online

Code

let r (f : 'a -> 'b) (a : 'a) : 'b =
    fun () ->
        f a
    |> fun f -> f ()

Result

let r (f : 'a -> 'b) (a : 'a) : 'b = fun () -> f a |> fun f -> f ()

Problem description

The concatenation of lines has caused the pipe operator to bind to a different expression.

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 at 06/30/2020 07:24:01 - dcc70c3

Name Value
IndentSpaceNum 4
PageWidth 120
SemicolonAtEndOfLine false
SpaceBeforeParameter true
SpaceBeforeLowercaseInvocation true
SpaceBeforeUppercaseInvocation true
SpaceBeforeClassConstructor true
SpaceBeforeMember true
SpaceBeforeColon true
SpaceAfterComma true
SpaceBeforeSemicolon true
SpaceAfterSemicolon true
IndentOnTryWith false
SpaceAroundDelimiter true
MaxIfThenElseShortWidth 40
MaxInfixOperatorExpression 50
MaxRecordWidth 40
MaxArrayOrListWidth 40
MaxValueBindingWidth 40
MaxFunctionBindingWidth 40
MultilineBlockBracketsOnSameColumn true
NewlineBetweenTypeDefinitionAndMembers true
KeepIfThenInSameLine true
MaxElmishWidth 40
SingleArgumentWebMode false
StrictMode false
nojaf added a commit that referenced this issue Jul 11, 2020
* Force infix expressions on next line for certain operators.

* Revert "Force infix expressions on next line for certain operators."

This reverts commit 3f9ac69.

* Force infix operator on a new line if a lambda is involved. Fixes #942
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant