Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packed array bug #12332

Closed
htqx opened this issue Aug 4, 2022 · 1 comment
Closed

packed array bug #12332

htqx opened this issue Aug 4, 2022 · 1 comment
Labels
bug Observed behavior contradicts documented or intended behavior

Comments

@htqx
Copy link

htqx commented Aug 4, 2022

Zig Version

0.10.0-dev.2977+7d2e14267

Steps to Reproduce

  const p5 = &packed struct{a:u32=1,b:[3]u8=.{2}**3,c:[20]u8=.{3}**20};
   var p6 = p5.*{};
   var p7:[20]u8 align(@alignOf(@TypeOf(p6.c))) = p6.c;

std.testing.expect(p7[0] == p6.c[0]) catch print("p7[0] ~= p6.c[0]",.{});

output: p7[0] ~= p6.c[0]
vars: 3 2

Expected Behavior

==

Actual Behavior

~=

@htqx htqx added the bug Observed behavior contradicts documented or intended behavior label Aug 4, 2022
@Vexu
Copy link
Member

Vexu commented Aug 4, 2022

Duplicate of #2627

@Vexu Vexu marked this as a duplicate of #2627 Aug 4, 2022
@Vexu Vexu closed this as completed Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

No branches or pull requests

2 participants