Can I somehow fix this code so that typescript prevents a and b from being used together?
type A = {
a: number;
}
type B = {
b: number;
}
type C = {
c: number;
}
type D = (A | B) & C;
const d0: D = { a: 123, c: 123 } // OK
const d1: D = { b: 123, c: 123 } // OK
const d2: D = { a: 123, b: 123, c: 123 } // NOT OK