@rbuckton <!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. --> **TypeScript Version:** master <!-- Search terms you tried before logging this (so others can find this issue more easily) --> **Search Terms:** **Code** ```ts declare const o: { x: 0 } | undefined; if (o?.x === 0) { o.x; } declare const a: [0] | undefined; if (a?.[0] === 0) { a[0]; } ``` **Expected behavior:** pass **Actual behavior:** ``` $ node built/local/tsc --noEmit --strict index.ts index.ts:3:3 - error TS2532: Object is possibly 'undefined'. 3 o.x; ~ index.ts:7:3 - error TS2532: Object is possibly 'undefined'. 7 a[0]; ~ Found 2 errors. ``` **Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior --> **Related Issues:** <!-- Did you find other bugs that looked similar? -->
Activity
arciisine commentedon Oct 4, 2019
This looks to be tied to #33736.
falsandtru commentedon Oct 4, 2019
The same idea is commented there but that issue doesn't aim it.