Skip to content

Nested objects are not checked #55852

New issue

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

Closed
vaynevayne opened this issue Sep 25, 2023 · 2 comments
Closed

Nested objects are not checked #55852

vaynevayne opened this issue Sep 25, 2023 · 2 comments
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug

Comments

@vaynevayne
Copy link

🔎 Search Terms

type TreeNode = {
name:string
} 



const authNameMap: Record<number, TreeNode> = {};

const a = authNameMap[1].name

🕗 Version & Regression Information

  • This is a crash
  • This changed between versions ______ and _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
  • I was unable to test this on prior versions because _______

⏯ Playground Link

https://www.typescriptlang.org/play?#code/C4TwDgpgBAKgThCA5A9gE2gXigbwFAB2AhgLYQBcAzsHAJYEDmeAvlHu3gMYoHVREBXYAAskpCAFkiYclABKEbnDQAeAgJIAjCHAA0sBMnQQAfFGw5mAbnbdewfuf5DR4qWADaARgC6AOmIyPCA

💻 Code

// Your code here

🙁 Actual behavior

ts Verification passed

🙂 Expected behavior

ts Verification not passed

Additional information about the issue

image
@MartinJohns
Copy link
Contributor

MartinJohns commented Sep 25, 2023

This is working as intended. This is what the noUncheckedIndexedAccess compiler option was added for. When you enable it the code will error.

Please make sure to fill out the issue template completely.

@ahejlsberg ahejlsberg added the Working as Intended The behavior described is the intended behavior; this is not a bug label Sep 25, 2023
@typescript-bot
Copy link
Collaborator

This issue has been marked as "Working as Intended" and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug
Projects
None yet
Development

No branches or pull requests

4 participants