leo/compiler/tests/array/spread.leo

7 lines
184 B
Plaintext
Raw Normal View History

// A spread operator `...` copies the elements of one array into another
2020-09-02 21:12:12 +03:00
function main(a: [u8; 3]) {
const b = [1u8, 1u8];
const c = [1u8, ...b];
2020-12-11 01:54:19 +03:00
console.assert(a == c);
}