Fix array->vector and vector->array for many types. Allow vector of bool.

Vectors do not have the same packing as arrays, and just bitcasting
is not the correct way to convert them.
This commit is contained in:
Shawn Landden
2019-07-25 11:11:37 -05:00
committed by Andrew Kelley
parent 914ad1ec2e
commit 0e3ca4c63e
5 changed files with 63 additions and 13 deletions

View File

@@ -6491,7 +6491,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
\\ var v: V = undefined;
\\}
,
"tmp.zig:2:26: error: vector element type must be integer, float, or pointer; '@Vector(4, u8)' is invalid",
"tmp.zig:2:26: error: vector element type must be integer, float, bool, or pointer; '@Vector(4, u8)' is invalid",
);
cases.add("compileLog of tagged enum doesn't crash the compiler",