Files
test-repo/tests/flow/destructuring/array_rest.js
T
Christopher Chedeau 3375cfe605 Move tests around (#454)
* new_tests

* move_all_clobbered_tests

* remove all the tests that no longer exist

* re-run flow tests

* Move all the flow tests to tests/flow and prettier to tests/

* Move prettier tests to their own folders

* Add jsfmt files

* run prettier snapshot tests
2017-01-24 14:35:37 -08:00

13 lines
314 B
JavaScript

let xs = [0, "", true];
let [a, ...ys] = xs;
let [b, ...zs] = ys;
let c = zs[0]; // retain tuple info
let d = zs[1]; // run off the end
(a: void); // error: number ~> void
(b: void); // error: string ~> void
(c: void); // error: boolean ~> void
(d: void); // error: number|string|boolean ~> void
let [...e] = 0;