mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
std.meta: give TagPayloadByName unreachable a better @compileError message
This commit is contained in:
parent
8af59d1f98
commit
c947e79d73
@ -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…
x
Reference in New Issue
Block a user