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

destructuring iterable fails to typecheck #8375

Open
skeggse opened this issue May 14, 2020 · 0 comments
Open

destructuring iterable fails to typecheck #8375

skeggse opened this issue May 14, 2020 · 0 comments

Comments

@skeggse
Copy link
Contributor

skeggse commented May 14, 2020

Flow version: v0.124.0

Flow should understand putting an iterable on the RHS of an array-destructuring assignment.

Expected behavior

declare var iterable: Iterable<number>;

// No error.
const [...array] = iterable;
(array: number[]);

Actual behavior

Note: for whatever reason, assigning an array to iterable in the interim makes flow happy.

References

Possibly related:

Terms:

spread, spreading, destructure, destructuring, array, iterable, iterator,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant