I get the following errors:
type Union = { type: "1"; foo: string } | { type: "2"; bar: number }; function doSomething = (object: Union)