Files
c3c/test/unit7/regression/cast_slice_to_arr.c3
2025-02-24 01:05:45 +01:00

17 lines
242 B
Plaintext

module slice_to_arr @test;
fn void to_arr()
{
int[] x = { 1, 2, 3, 4, 5 };
int z = 2;
int[2] y = x[z:2];
assert(y == {3, 4});
}
fn void to_vec()
{
int[] x = { 1, 2, 3, 4, 5 };
int z = 2;
int[<2>] y = x[z:2];
assert(y == { 3, 4 });
}