Skip to content
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

Arbitrary number properties are allowed #1512

Closed
vkurchatkin opened this issue Mar 8, 2016 · 4 comments
Closed

Arbitrary number properties are allowed #1512

vkurchatkin opened this issue Mar 8, 2016 · 4 comments
Labels
Typing: soundness No false negatives (type checker claims that there is no error in the incorrect program)

Comments

@vkurchatkin
Copy link
Contributor

This type-checks:

type O = {};

function stuff(o: O) {
  const b = o[0].ff.ffa
}

o[0] behaves as it it was declared as any

@vkurchatkin
Copy link
Contributor Author

This is still an issue.

@JohnyDays
Copy link
Contributor

I think, if you want this to type-check you have to seal the object. E.g type O = { [key: string]: void };

@vkurchatkin
Copy link
Contributor Author

Nope, this is definitely a bug, for example changing [0] to ['0'] fixes the problem

@gkz
Copy link
Member

gkz commented Dec 11, 2023

Fixed in 80ca16f

@gkz gkz closed this as completed Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typing: soundness No false negatives (type checker claims that there is no error in the incorrect program)
Projects
None yet
Development

No branches or pull requests

3 participants