-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Poor typing for array iterator #34581
Comments
You'll get correct type error if you verify that
|
Cause of this is that |
I wonder whether it would have been possible to use |
Oh, see discussion at #33353 |
This is essentially a duplicate of #33353. |
TypeScript Version: 3.6.3
Search Terms: Array iterator
Code
Expected behavior:
A type check error that number cannot be string.
Actual behavior:
No type check error.
Playground Link: https://www.typescriptlang.org/play/?ssl=1&ssc=1&pln=4&pc=1#code/MYewdgzgLgBAhgJwXAnjAvDA2gRgLoDcAsAFCiSwCWUApslCAhvEqlgMooC2ARiADYA6anTgMEeABQBKYmXDQYANzj8ArjQBcMaAkpgA5sxH1GgsDQAeUGYJXqaBGAHpnMUFwAOlfjRh0ERlIgA
Related Issues:
I do not that Iterators/Generators were changed recently. IDK if that is related.
The text was updated successfully, but these errors were encountered: