Skip to content

Fantomas corrupts an explicit constructor with then clause #3074

@xperiandri

Description

@xperiandri

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions