var ram align(2): [128]u1 = undefined;
// ... modifying ram
std.debug.print("{}\n", .{ @as([]u16, @ptrCast(ram[0..16]))});
Should the compiler not allow this or am I misunderstanding something?
Casting from []u1 to:
[]u16compile error:error: TODO: implement @ptrCast between slices changing the length[*]u16works, but the value of[0]seems to always be 0*u16same as above with the multi ptr
Casting from([0..16]ram).*seems to show why it isn't working:error: @bitCast size mismatch: destination type 'u16' has 16 bits but source type '[16]u1' has 121 bits
So, in the end is there a quick way to convert from []u1 to u16 and is there such a thing as a packed array?