We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
Array isArray unknown any type guard
3.3.3 - 4.3.4
Playground link with relevant code
const x: unknown = ['asdasd'] if (Array.isArray(x)) { x[0] - 123123 }
It passes type checking
I would expect it to fail because although x is an array, x[0] should still be unknown. I'd expect to be forced to check the type of the items
The text was updated successfully, but these errors were encountered:
Duplicate of #44703 / #41808. Search terms: Array.isArray in:title
Array.isArray in:title
Sorry, something went wrong.
^ I saw that issue but it is very vague and I couldn't work out if it is the same problem
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.
No branches or pull requests
Bug Report
π Search Terms
Array isArray unknown any type guard
π Version & Regression Information
3.3.3 - 4.3.4
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
It passes type checking
π Expected behavior
I would expect it to fail because although x is an array, x[0] should still be unknown. I'd expect to be forced to check the type of the items
The text was updated successfully, but these errors were encountered: