authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-08-17 14:06:47-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-08-17 14:09:42-07:00
log2cccd144914d8715894458f317fa4c3c572cdcad
tree9c323487031224f7d169b419ecfb74c3eb3b7a9b
parent59b6483d63ca68f63c0b3758e80da918629ada2c

fix typo in compile error message


2 files changed, 3 insertions(+), 4 deletions(-)

src/Sema.zig+1-1
......@@ -11211,7 +11211,7 @@ fn zirDiv(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.Ins
1121111211 const rhs_val = maybe_rhs_val orelse unreachable;
1121211212 const rem = lhs_val.floatRem(rhs_val, resolved_type, sema.arena, target) catch unreachable;
1121311213 if (rem.compareWithZero(.neq)) {
11214 return sema.fail(block, src, "ambiguous coercion of division operands '{s}' and '{s}'; division has non-zero reminder '{}'", .{
11214 return sema.fail(block, src, "ambiguous coercion of division operands '{s}' and '{s}'; non-zero remainder '{}'", .{
1121511215 @tagName(lhs_ty.tag()), @tagName(rhs_ty.tag()), rem.fmtValue(resolved_type, sema.mod),
1121611216 });
1121711217 }
test/cases/compile_errors/ambiguous_coercion_of_division_operands.zig+2-3
......@@ -15,10 +15,9 @@ export fn entry4() void {
1515 _ = f;
1616}
1717
18
1918// error
2019// backend=stage2
2120// target=native
2221//
23// :2:23: error: ambiguous coercion of division operands 'comptime_float' and 'comptime_int'; division has non-zero reminder '4'
24// :6:21: error: ambiguous coercion of division operands 'comptime_int' and 'comptime_float'; division has non-zero reminder '4'
22// :2:23: error: ambiguous coercion of division operands 'comptime_float' and 'comptime_int'; non-zero remainder '4'
23// :6:21: error: ambiguous coercion of division operands 'comptime_int' and 'comptime_float'; non-zero remainder '4'