microsoft / TypeScript Public
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
Array binding pattern with only OmittedExpressions does not check RHS of for-of loop #48630
Comments
|
Can I give this issue a try? |
Yes, feel free. |
|
Can I get some help on where I should begin looking to tackle this issue? Thanks! |
|
You should take a look in |
|
Hi, sorry for another question, but I had been trying to fix the problem but I am not sure whether the [,] counts as a variable declaration or array literal. Could I get a clarification on that? |
|
Hi there, if this is not being actively worked on right now, may I give this a try? |
|
Hi @RyanCavanaugh @Fireboltofdeath, I made a PR for this issue, please check at your latest convenience! Much thanks. |
β¦not check RHS of for-of loop (#49008) * fix RHS of for..of loop not evaluated when LHS is array binding element with OmittedExpression * expand widened type check * add more test cases * update code with suggestions * Make test target es2015 Co-authored-by: Andrew Branch <andrew@wheream.io>
Bug Report
array binding patterns for-of loop omittedexpression binding elements
Playground link with relevant code
The right hand side of the for-of loop is not checked at all.
This appears to be because
OmittedExpressionis not actually aBindingElementand the right hand side's type is only checked whenever encountering aBindingElementincheckVariableLikeDeclarationor when there are no elements in the pattern.The right hand side of the for-of loop to be checked.
The text was updated successfully, but these errors were encountered: