We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
0.11.0-dev.811+8ff9284c4
Using @sizeOf on an optional union produces a value of 1.
@sizeOf
const std = @import("std"); pub fn main() !void { const Node = union { a: usize, }; var output = std.io.getStdOut().writer(); inline for (.{ ?Node, Node, }) |typ| { try output.print("{s} is {} bytes, align is {}\n", .{ @typeName(typ), @sizeOf(typ), @alignOf(typ) }); } }
With 0.11.0-dev.811+8ff9284c4 this prints
?test.main.Node is 1 bytes, align is 8 test.main.Node is 8 bytes, align is 8
With 0.10.0 and -fstage1 this prints
0.10.0
-fstage1
?Node is 16 bytes, align is 8 Node is 8 bytes, align is 8
The stage1 behavior appears correct.
The text was updated successfully, but these errors were encountered:
Type: fix incorrect usage of hasRuntimeBits
hasRuntimeBits
f494932
Closes ziglang#13962
5665862
847569d
728dd29
No branches or pull requests
Zig Version
0.11.0-dev.811+8ff9284c4
Steps to Reproduce and Observed Behavior
Using
@sizeOf
on an optional union produces a value of 1.With
0.11.0-dev.811+8ff9284c4
this printsWith
0.10.0
and-fstage1
this printsExpected Behavior
The stage1 behavior appears correct.
The text was updated successfully, but these errors were encountered: