Closed
Description
Bug Report
π Search Terms object property union elimination
β― Playground Link
Playground link with relevant code
π» Code
type A = { a: '1', b: string } | { a: '2' | '3' }
declare const a: A
if (a.a !== '2' && a.a !== '3') {
// (property) a: "1"
a.a
// Property 'b' does not exist on type 'A'.
// Property 'b' does not exist on type '{ a: "2" | "3"; }'.(2339)
a.b
}
π Actual behavior
Error: Property 'b' does not exist on type 'A'.
π Expected behavior
No error