You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
conststd=@import("std");
constParent=struct {
child: Child,
};
constChild=struct {};
test"" {
varp=Parent{ .child= .{} };
varc=&p.child;
// Fails with "error: pointer value not based on parent struct", 'c' is resolved to be comptime and not set to point to a parent struct correctly.std.debug.assert(@fieldParentPtr(Parent, "child", c) ==&p);
}
Workaround: add any non-zero sized state to Child
The text was updated successfully, but these errors were encountered:
alexnask
changed the title
@fieldParentPtr always fails for zero size type pointers.
@fieldParentPtr always fails for zero sized type field pointers.
Mar 2, 2020
Workaround: add any non-zero sized state to Child
The text was updated successfully, but these errors were encountered: