authorgravatar for clickingbuttons@pm.meclickingbuttons <clickingbuttons@pm.me> 2024-04-22 14:02:32-04:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2024-04-23 01:50:10+03:00
logc947e79d73d3ec7a7a7c4640f001b34f63d36d89
tree7c778f2cbe77e1ebc0e578185583c88c018520b8
parent8af59d1f98266bd70b3afb44d196bbd151cedf22

std.meta: give TagPayloadByName unreachable a better @compileError message


1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/meta.zig+1-1
...@@ -719,7 +719,7 @@ pub fn TagPayloadByName(comptime U: type, comptime tag_name: []const u8) type {...@@ -719,7 +719,7 @@ pub fn TagPayloadByName(comptime U: type, comptime tag_name: []const u8) type {
719 return field_info.type;719 return field_info.type;
720 }720 }
721721
722 unreachable;722 @compileError("no field '" ++ tag_name ++ "' in union '" ++ @typeName(U) ++ "'");
723}723}
724724
725/// Given a tagged union type, and an enum, return the type of the union field725/// Given a tagged union type, and an enum, return the type of the union field