mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
std.meta: give TagPayloadByName unreachable a better @compileError message
This commit is contained in:
parent
8af59d1f98
commit
c947e79d73
1 changed files with 1 additions and 1 deletions
|
|
@ -719,7 +719,7 @@ pub fn TagPayloadByName(comptime U: type, comptime tag_name: []const u8) type {
|
|||
return field_info.type;
|
||||
}
|
||||
|
||||
unreachable;
|
||||
@compileError("no field '" ++ tag_name ++ "' in union '" ++ @typeName(U) ++ "'");
|
||||
}
|
||||
|
||||
/// Given a tagged union type, and an enum, return the type of the union field
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue