Skip to content

Comment after let binding breaks downstream output #1284

Closed
@deviousasti

Description

Issue created from fantomas-online

Code

let value = // TODO: some comment
    let v = 2 + 3
    v

let k = -1

Error

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

Formatted result:

let value = // TODO: some comment
    let v =2 + 3
    v

let k =-1

Problem description

isValidFSharpCode fails if there's a comment after a let binding which doesn't immediately return a value.

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 12/11/2020 14:28:39 - 5a66ce5

Default Fantomas configuration

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