Add a compiler error for @mulAdd with int vectors.

This commit is contained in:
IntegratedQuantum 2023-06-13 10:16:51 +02:00 committed by Andrew Kelley
parent df6319418a
commit 02df9aa976
2 changed files with 11 additions and 2 deletions

View File

@ -22670,8 +22670,8 @@ fn zirMulAdd(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.
const maybe_addend = try sema.resolveMaybeUndefVal(addend);
const mod = sema.mod;
switch (ty.zigTypeTag(mod)) {
.ComptimeFloat, .Float, .Vector => {},
switch (ty.scalarType(mod).zigTypeTag(mod)) {
.ComptimeFloat, .Float => {},
else => return sema.fail(block, src, "expected vector of floats or float type, found '{}'", .{ty.fmt(sema.mod)}),
}

View File

@ -0,0 +1,9 @@
comptime {
_ = @mulAdd(@Vector(1, u32), .{0}, .{0}, .{0});
}
// error
// backend=stage2
// target=native
//
// :2:9: error: expected vector of floats or float type, found '@Vector(1, u32)'