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