-
-
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 behavior
Milestone
Description
Zig Version
0.11.0-dev.1265+3ab43988c
Steps to Reproduce and Observed Behavior
pub const Val = packed struct {
const Self = @This();
isTagged: bool,
body: packed union {
u63: u63,
tagged: packed union {
tags: enum(u3) {
u32 = 0,
i32 = 1,
static = 2,
object = 3,
symbol = 4,
bitSet = 5,
status = 6,
},
body: packed union {
static: enum(u60) {
void = 0,
true = 1,
false = 2,
},
},
},
},
};
const v: Val = @bitCast(Val, @as(u64, 2));
thread 2478416 panic: TODO implement readFromPackedMemory for more types
Expected Behavior
I expected to be able to bit cast from a u64 to a Val, which is a 64-bit sized packed struct.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior