mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 14:25:16 +00:00
Add a compiler error for @mulAdd with int vectors.
This commit is contained in:
parent
df6319418a
commit
02df9aa976
@ -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)}),
|
||||
}
|
||||
|
||||
|
||||
9
test/cases/compile_errors/muladd_int_vector.zig
Normal file
9
test/cases/compile_errors/muladd_int_vector.zig
Normal 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)'
|
||||
Loading…
x
Reference in New Issue
Block a user