We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@rbuckton
TypeScript Version: master
Search Terms:
Code
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:
Related Issues:
The text was updated successfully, but these errors were encountered:
This looks to be tied to #33736.
Sorry, something went wrong.
The same idea is commented there but that issue doesn't aim it.
ahejlsberg
Successfully merging a pull request may close this issue.
@rbuckton
TypeScript Version: master
Search Terms:
Code
Expected behavior:
pass
Actual behavior:
Playground Link:
Related Issues:
The text was updated successfully, but these errors were encountered: