stage1: Fix type-checking of unary neg for vector types
Validate the vector element type as done for the scalar case. Fixes #6708
This commit is contained in:
@@ -8172,14 +8172,19 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
|
||||
, &[_][]const u8{
|
||||
"tmp.zig:2:9: error: @wasmMemoryGrow is a wasm32 feature only",
|
||||
});
|
||||
|
||||
cases.add("Issue #5586: Make unary minus for unsigned types a compile error",
|
||||
\\export fn f(x: u32) u32 {
|
||||
\\export fn f1(x: u32) u32 {
|
||||
\\ const y = -%x;
|
||||
\\ return -y;
|
||||
\\}
|
||||
\\const V = @import("std").meta.Vector;
|
||||
\\export fn f2(x: V(4, u32)) V(4, u32) {
|
||||
\\ const y = -%x;
|
||||
\\ return -y;
|
||||
\\}
|
||||
, &[_][]const u8{
|
||||
"tmp.zig:3:12: error: negation of type 'u32'",
|
||||
"tmp.zig:8:12: error: negation of type 'u32'",
|
||||
});
|
||||
|
||||
cases.add("Issue #5618: coercion of ?*c_void to *c_void must fail.",
|
||||
|
||||
Reference in New Issue
Block a user