From 022a71ca7d68d970418a93a5c5b3bec9e1fdf9f2 Mon Sep 17 00:00:00 2001 From: foobles Date: Tue, 14 Apr 2020 15:19:45 -0500 Subject: [PATCH] Shift error message now says "fixed-width integer type" instead of just "integer type" (#5028) * error message of ir_analyze_bit_shift now more accurate/specific * fixed compile error test to match bit shift error message --- src/ir.cpp | 2 +- test/compile_errors.zig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ir.cpp b/src/ir.cpp index b9438dda38..eb7308e8f5 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -16974,7 +16974,7 @@ static IrInstGen *ir_analyze_bit_shift(IrAnalyze *ira, IrInstSrcBinOp *bin_op_in if (!instr_is_comptime(op2)) { ir_add_error(ira, &bin_op_instruction->base.base, - buf_sprintf("LHS of shift must be an integer type, or RHS must be compile-time known")); + buf_sprintf("LHS of shift must be a fixed-width integer type, or RHS must be compile-time known")); return ira->codegen->invalid_inst_gen; } diff --git a/test/compile_errors.zig b/test/compile_errors.zig index 4db3ef3c99..4b60deec1c 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -5925,7 +5925,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { \\ return 0x11 << x; \\} , &[_][]const u8{ - "tmp.zig:2:17: error: LHS of shift must be an integer type, or RHS must be compile-time known", + "tmp.zig:2:17: error: LHS of shift must be a fixed-width integer type, or RHS must be compile-time known", }); cases.add("shifting RHS is log2 of LHS int bit width",