4 ms·
I had to search for this, but managed to find the relevant mlugg@ comment[0] on the ZSF zulip: > i had to change the bytes field from [*]align(@alignOf(T)) u8
by messe 7mo ago
I had to search for this, but managed to find the relevant mlugg@ comment[0] on the ZSF zulip:
> i had to change the bytes field from [*]align(@alignOf(T)) u8 to just [*]u8 (and cast the alignment back in the like one place that field is accessed). this wasn't necessary for MultiArrayList in and of itself, but it was necessary for embedding a MultiArrayList(T) inside of T without a dependency loop, like
const T = struct {
children: MultiArrayList(T),
};
// reproduced for completeness:
fn MultiArrayList(comptime T: type) type {
return struct {
bytes: [*]align(@alignOf(T)) u8,
// ...
};
}
[0]: https://zsf.zulipchat.com/#narrow/channel/454360-compiler/topic/type.20resolution/near/533972426 https://zsf.zulipchat.com/#narrow/channel/454360-compiler/to...
- skavi 7mo agoAh, that makes sense. Thanks for pulling this up!
- messe 7mo agoHe went into it a bit more over on Ziggit today too. I only noticed it way after I went digging: https://ziggit.dev/t/devlog-type-resolution-redesign-with-language-changes-to-taste/14579/5 https://ziggit.dev/t/devlog-type-resolution-redesign-with-la...