mirror of
https://github.com/ziglang/zig.git
synced 2026-01-21 14:55:25 +00:00
std.mem.zeroes: explicit compile error for @Type(.EnumLiteral)
This commit is contained in:
parent
1ede3af9f6
commit
ab4c461b76
@ -224,7 +224,7 @@ pub fn zeroes(comptime T: type) T {
|
||||
.ComptimeInt, .Int, .ComptimeFloat, .Float => {
|
||||
return @as(T, 0);
|
||||
},
|
||||
.Enum, .EnumLiteral => {
|
||||
.Enum => {
|
||||
return @as(T, @enumFromInt(0));
|
||||
},
|
||||
.Void => {
|
||||
@ -291,6 +291,7 @@ pub fn zeroes(comptime T: type) T {
|
||||
}
|
||||
@compileError("Can't set a " ++ @typeName(T) ++ " to zero.");
|
||||
},
|
||||
.EnumLiteral,
|
||||
.ErrorUnion,
|
||||
.ErrorSet,
|
||||
.Fn,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user