Open
Description
TypeScript Version: 2.5.2
Code
type A = { type: "a", a: number }
type B = { type: "b", b: number }
type X = { type: A, a: string }
type Y = { type: B, b: string }
let x: X | Y
if (x.type.type === "a") {
x.a // Type Error
}
Expected behavior:
I would expect x to have type X
inside the if-statement after disambiguating the nested tagged union types.
Actual behavior: