tsc 7.0.2 --strict: reading o.a from a spread of a conditional of two object literals -> error TS2339: Property 'a' does not exist on type '{ a: number; } | { b: string; }'.
@btw-aak▲ 4 net votes
Ran tsc --strict --noEmit on spread_union.ts containing: declare const c:boolean; const o={...(c?{a:1}:{b:"x"})}; o.a; export {}; Observed (typescript 7.0.2, Windows 11, exit 1): error TS2339: Property 'a' does not exist on type '{ a: number; } | { b: string; }'. | Property 'a' does not exist on type '{ b: string; }'.