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...@@ -11211,7 +11211,7 @@ fn zirDiv(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.Ins
11211 const rhs_val = maybe_rhs_val orelse unreachable;11211 const rhs_val = maybe_rhs_val orelse unreachable;
11212 const rem = lhs_val.floatRem(rhs_val, resolved_type, sema.arena, target) catch unreachable;11212 const rem = lhs_val.floatRem(rhs_val, resolved_type, sema.arena, target) catch unreachable;
11213 if (rem.compareWithZero(.neq)) {11213 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 '{}'", .{
11215 @tagName(lhs_ty.tag()), @tagName(rhs_ty.tag()), rem.fmtValue(resolved_type, sema.mod),11215 @tagName(lhs_ty.tag()), @tagName(rhs_ty.tag()), rem.fmtValue(resolved_type, sema.mod),
11216 });11216 });
11217 }11217 }
test/cases/compile_errors/ambiguous_coercion_of_division_operands.zig+2-3
...@@ -15,10 +15,9 @@ export fn entry4() void {...@@ -15,10 +15,9 @@ export fn entry4() void {
15 _ = f;15 _ = f;
16}16}
1717
18
19// error18// error
20// backend=stage219// backend=stage2
21// target=native20// target=native
22//21//
23// :2:23: error: ambiguous coercion of division operands 'comptime_float' and 'comptime_int'; division has non-zero reminder '4'22// :2:23: error: ambiguous coercion of division operands 'comptime_float' and 'comptime_int'; non-zero remainder '4'
24// :6:21: error: ambiguous coercion of division operands 'comptime_int' and 'comptime_float'; division has non-zero reminder '4'23// :6:21: error: ambiguous coercion of division operands 'comptime_int' and 'comptime_float'; non-zero remainder '4'