-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.
Milestone
Description
Zig Version
0.10.0-dev.4430+99c3578f
Steps to Reproduce
test {
const T = extern struct{ i: u64 = 0, x: u16 = 0};
var x = T{};
//_ = @bitCast(u128, x); // error on stage2
_ = @bitCast(u80, x); // error on stage1
}Expected Behavior
I'd expect the @bitCast to be with respect to the actual layout size of the struct, not the sum of the packed size of its fields.
Actual Behavior
Cast is allowed to u80, but not u128.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.