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 corrupts an explicit constructor with then clause #3074

Closed
xperiandri opened this issue Apr 11, 2024 · 2 comments · Fixed by #3075
Closed

Fantomas corrupts an explicit constructor with then clause #3074

xperiandri opened this issue Apr 11, 2024 · 2 comments · Fixed by #3075

Comments

@xperiandri
Copy link

xperiandri commented Apr 11, 2024

Issue created from fantomas-online

image

Code

type CreateBuildingViewModel =
    inherit ResizeArray

    new (items) as vm
        =
        let p = ""
        {
            inherit ResizeArray(seq {
                yield p
                yield! items
            })
        }
        then
            vm.program <- p

    [<DefaultValue>]
    val mutable program : string

Result

type CreateBuildingViewModel =
    inherit ResizeArray

    new(items) as vm =
        let p = ""

        { inherit
            ResizeArray(
                seq {
                    yield p
                    yield! items
                }
            ) }

        vm.program <- p

    [<DefaultValue>]
    val mutable program: string

Problem description

then keyword is removed which corrupts code logic and results in compile time error

Extra information

  • The formatted result breaks my code.
  • The formatted result gives compiler warnings.
  • I would like a release if this problem is solved.

Options

Fantomas 6.3.0

@nojaf
Copy link
Contributor

nojaf commented Apr 12, 2024

Hi, thank for the report.
Your .editorconfig is irrelevant to this problem, so please don't bring it up as it only adds to the cognitive load.

@xperiandri
Copy link
Author

Removed. Thanks!

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