rescript-compiler
rescript-compiler copied to clipboard
Weird reformatting when placing line comment before spread syntax
Example before reformatting (Playground link):
type t = {
foo: string,
bar: string,
}
let a: t = {
foo: "test",
bar: "test",
}
let b = {
// PROBLEM: This comment moves after the "..." when reformatted.
...a,
bar: "foo"
}
After reformatting:
type t = {
foo: string,
bar: string,
}
let a: t = {
foo: "test",
bar: "test",
}
let b = {
...// PROBLEM: This comment moves after the "..." when reformatted.
a,
bar: "foo",
}
To my surprise, this code still compiles. Nonetheless I think the comment should stay in the same place when formatting.