-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.This issue suggests modifications. If it also has the "accepted" label then it is planned.
Milestone
Description
Since bit aligned pointers is represented as meta data on the pointer type at compile time, it doesn't make sense to allow @ptrToInt on these pointers, as the address cannot be represented at runtime.
const A = packed struct {
a: u4,
b: u4
};
test \"\" {
var a: A = undefined;
_ = @ptrToInt(&a.a); // This is ok. a.a is on a byte bound so we can have a runtime address to it
_ = @ptrToInt(&a.b); // This should be an error. The address this will return is actually the address to ´a.a´
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.This issue suggests modifications. If it also has the "accepted" label then it is planned.