-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
error messageThis issue points out an error message that is unhelpful and should be improved.This issue points out an error message that is unhelpful and should be improved.
Description
Zig Version
0.15.1
Steps to Reproduce and Observed Output
Minimal Repro
const my_enum = enum { variant };
const value: my_enum = .variant;
std.debug.print("value: {:12}\n", .{value});Output Error
value: thread 5367751 panic: reached unreachable code
/opt/homebrew/Cellar/zig/0.15.1/lib/zig/std/debug.zig:559:14: 0x104babe07 in assert (zenzei)
if (!ok) unreachable; // assertion failure
^
/opt/homebrew/Cellar/zig/0.15.1/lib/zig/std/Io/Writer.zig:1402:11: 0x104c0b94f in optionsForbidden (zenzei)
assert(options.width == null);
^
/opt/homebrew/Cellar/zig/0.15.1/lib/zig/std/Io/Writer.zig:1252:29: 0x104c4d513 in printValue__anon_21994 (zenzei)
optionsForbidden(options);
^
/opt/homebrew/Cellar/zig/0.15.1/lib/zig/std/Io/Writer.zig:700:25: 0x104c43cc7 in print__anon_19725 (zenzei)
try w.printValue(
^
/opt/homebrew/Cellar/zig/0.15.1/lib/zig/std/debug.zig:231:23: 0x104c4049f in print__anon_19477 (zenzei)
nosuspend bw.print(fmt, args) catch return;
^
/Users/philogy/Documents/Sensei/zenzei/src/main.zig:12:20: 0x104c4041f in main (zenzei)
std.debug.print("value: {:12}\n", .{value});
Expected Output
Ideally a simple print with alignment:
value: .variant
Or at least a better panic message in the shape of:
thread 5364281 panic: formatting with width, alignment & fill not supported for enums
.... remaining trace
rohlem
Metadata
Metadata
Assignees
Labels
error messageThis issue points out an error message that is unhelpful and should be improved.This issue points out an error message that is unhelpful and should be improved.