mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:44:43 +01:00
std.testing: improve compile error on untagged union equality
This commit is contained in:
parent
ddff1fa4c6
commit
86064e66d6
1 changed files with 2 additions and 2 deletions
|
|
@ -147,7 +147,7 @@ fn expectEqualInner(comptime T: type, expected: T, actual: T) !void {
|
|||
|
||||
.@"union" => |union_info| {
|
||||
if (union_info.tag_type == null) {
|
||||
@compileError("Unable to compare untagged union values");
|
||||
@compileError("Unable to compare untagged union values for type " ++ @typeName(@TypeOf(actual)));
|
||||
}
|
||||
|
||||
const Tag = std.meta.Tag(@TypeOf(expected));
|
||||
|
|
@ -818,7 +818,7 @@ fn expectEqualDeepInner(comptime T: type, expected: T, actual: T) error{TestExpe
|
|||
|
||||
.@"union" => |union_info| {
|
||||
if (union_info.tag_type == null) {
|
||||
@compileError("Unable to compare untagged union values");
|
||||
@compileError("Unable to compare untagged union values for type " ++ @typeName(@TypeOf(actual)));
|
||||
}
|
||||
|
||||
const Tag = std.meta.Tag(@TypeOf(expected));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue