Given the following:
type TestUnion = { a: true } | { b: true };
const shouldFail: TestUnion = { a: true, b: true };
I'd expect that shouldFail
would have a compilation error since it doesn't match either side of the union. However, this is compiling just fine. (Typescript 3.5.1)
Am I misunderstanding something about how union types work?