Language
Typescript
Input
type TaggedUnion =
| { type: 'number', a: number, b: number }
| { type: 'string', z: string, y: string }
Expected output
I think keeping tags of tagged unions at beginning (and perhaps sort by the tag?) would be sensible in this situation.
type TaggedUnion =
| { type: 'number', a: number, b: number }
| { type: 'string', y: string, z: string }
Actual output (or error message)
type TaggedUnion =
| { a: number, b: number, type: 'number' }
| { type: 'string', y: string, z: string }