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

Fantomas format is "unstable/oscillates" after upcast operator: adds/removes empty line #1227

Closed
1 of 3 tasks
kodfodrasz opened this issue Nov 6, 2020 · 0 comments · Fixed by #1229
Closed
1 of 3 tasks

Comments

@kodfodrasz
Copy link

kodfodrasz commented Nov 6, 2020

Issue created from fantomas-online

Code

module S3v2

open System.Threading.Tasks
open Amazon.Runtime

let waitAndUpcast (x: Task<'t>) =
    let t =
        x |> Async.AwaitTask |> Async.RunSynchronously
    x.Result :> AmazonWebServiceResponse

Result

module S3v2

open System.Threading.Tasks
open Amazon.Runtime

let waitAndUpcast (x: Task<'t>) =
    let t =
        x |> Async.AwaitTask |> Async.RunSynchronously

    x.Result :> AmazonWebServiceResponse

Problem description

After having run the formatter on the code above, an empty line was added before the x.Result :> AmazonWebServiceResponse line.
When the output is pasted to the input field the line will be removed.
Eventually re-running fantomas with the snippet above will oscillate between two state differing only in that empty line.

I have noticed this while running fantomas 4.2.0 locally in check mode on a file with the above snippet in it.

When the upcast operation (:> AmazonWebServiceResponse) is removed the code formatting is stable.

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

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 11/02/2020 11:33:23 - f7b8f3a

Default Fantomas configuration

@kodfodrasz kodfodrasz changed the title Fantomas format is "unstable" after upcast operator: adds/removes empty line Fantomas format is "unstable/oscillates" after upcast operator: adds/removes empty line Nov 6, 2020
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