Skip to content

Formatting empty dictionary deletes any comments and inserts invalid trailing comma #7652

@mediremi

Description

@mediremi

This issue is present since v12.0.0-alpha.3.

The formatter strips comments from dictionaries without keys and inserts a syntactically invalid trailing comma:

// Before formatter

let _: dict<()> = dict{
  // a comment
}
// After formatter

let _: dict<unit> = dict{
  ,
}

Playground link

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions