Add workaround in PackedIntArray .initAllTo for #7635

This commit is contained in:
daurnimator 2021-01-02 01:10:47 +11:00
parent 31ba9d569b
commit 03e2c53747
No known key found for this signature in database
GPG Key ID: 45B429A8F9D9D22A

View File

@ -205,7 +205,8 @@ pub fn PackedIntArrayEndian(comptime Int: type, comptime endian: builtin.Endian,
///Initialize all entries of a packed array to the same value
pub fn initAllTo(int: Int) Self {
var self = @as(Self, undefined);
// TODO: use `var self = @as(Self, undefined);` https://github.com/ziglang/zig/issues/7635
var self = Self{ .bytes = [_]u8{0} ** total_bytes };
self.setAll(int);
return self;
}