Skip to content

Fantomas removes the 'and' if there are multiple member constraints on a function declaration #886

Closed
@JackMatusiewicz

Description

Issue created from fantomas-online

When a function has multiple member constraints, fantomas will remove the 'and' leading to invalid F# code

Code

namespace Blah

module Foo =
    val inline sum : ('a -> ^value) -> 'a Foo -> ^value
        when ^value : (static member (+) : ^value * ^value -> ^value) and ^value : (static member Zero : ^value)

Error

Fantomas was able to format the code but the result appears to be invalid F# code.
Please open an issue.

Formatted result:

namespace Blah

module Foo =
    val inline sum: ('a -> ^value) -> 'a Foo -> ^value when ^value: (static member (+): ^value * ^value -> ^value) ^value: (static member Zero: ^value)

Options

Fantomas Master at 06/02/2020 18:39:46 - eee0f32

Name Value
IndentSpaceNum 4
PageWidth 120
SemicolonAtEndOfLine false
SpaceBeforeParameter true
SpaceBeforeLowercaseInvocation true
SpaceBeforeUppercaseInvocation false
SpaceBeforeClassConstructor false
SpaceBeforeMember false
SpaceBeforeColon false
SpaceAfterComma true
SpaceBeforeSemicolon false
SpaceAfterSemicolon true
IndentOnTryWith false
SpaceAroundDelimiter true
MaxIfThenElseShortWidth 40
MaxInfixOperatorExpression 50
MaxRecordWidth 40
MaxArrayOrListWidth 40
MaxLetBindingWidth 40
MultilineBlockBracketsOnSameColumn false
NewlineBetweenTypeDefinitionAndMembers false
KeepIfThenInSameLine false
StrictMode false

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions