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

Record member declarations can break with Stroustrup enabled #2787

Closed
2 of 3 tasks
josh-degraw opened this issue Mar 6, 2023 · 2 comments · Fixed by #2788
Closed
2 of 3 tasks

Record member declarations can break with Stroustrup enabled #2787

josh-degraw opened this issue Mar 6, 2023 · 2 comments · Fixed by #2788

Comments

@josh-degraw
Copy link
Contributor

Issue created from fantomas-online

Code

namespace Some.Namespace

[<Interface>]
type IEvent = interface end

type SomeEvent =
    { Id: string
      Name: string }
    interface IEvent

type UpdatedName = { PreviousName: string }

Result

namespace Some.Namespace

[<Interface>]
type IEvent =
    interface
    end

type SomeEvent = {
    Id: string
    Name: string
} with

    interface IEvent

    type UpdatedName = { PreviousName: string }

Problem description

We use an empty interface for a few things, and updating my code to run the latest alpha seems to break in those places when I turn on the Stroustrup setting if anything comes afterwards. I'll try and get a PR up for this soon.

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.

Options

Fantomas v6 branch at 3/6/23

    { config with
                MultilineBracketStyle = Stroustrup }

Did you know that you can ignore files when formatting from fantomas-tool or the FAKE targets by using a .fantomasignore file?

@nojaf
Copy link
Contributor

nojaf commented Mar 6, 2023

Just an FYI, this breaks with other stuff as well: example

We are probably missing some unindent call under the right conditions.

@josh-degraw josh-degraw changed the title Empty interface record implementation breaks with stroustrup Record member declarations can break with Stroustrup enabled Mar 6, 2023
@nojaf
Copy link
Contributor

nojaf commented Apr 13, 2023

Available in v6.

@nojaf nojaf closed this as completed Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants