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
implicitly has type 'any' 7022
Playground link with relevant code
let children: string | A[] = [] while (typeof children !== 'string') { const index = children.length - 1 children = children[index].children } interface A { children: A[] | string }
'index' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer
No error here
The text was updated successfully, but these errors were encountered:
Duplicate of #43047. The type of index depends on the type of children, the type of children depends on the type of index (due to the reassignment).
index
children
Just add a type annotation.
Sorry, something went wrong.
No branches or pull requests
Bug Report
π Search Terms
implicitly has type 'any' 7022
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
'index' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer
π Expected behavior
No error here
The text was updated successfully, but these errors were encountered: