Skip to content

{A.a, b} is reformatted incorrectly #5362

Closed
rescript-lang/syntax
#479
@cknitt

Description

@cknitt

The following code

module A = {
  type t = {a: int, b: string}
}

let f = (~a, ~b) => {A.a, b}

gets reformatted to

module A = {
  type t = {a: int, b: string}
}

let f = (~a, ~b) => {A.a: A.a, b: b}

which does not compile.

Instead, it should be reformatted to

module A = {
  type t = {a: int, b: string}
}

let f = (~a, ~b) => {A.a: a, b: b}

Or even better, the punning in the original code should be kept as is, see also rescript-lang/syntax#47.

Metadata

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