unfortunately, i’m unable to create a “small” self-contained example of the issue… but here’s a small snip from my codebase that illustrates problem…
em.print("AppBut = {any}\n", .{AppBut});
em.print("before: Edge = {any}\n", .{AppBut.Edge});
em.print("before: Edge._upath = {s}\n", .{AppBut.Edge._upath});
AppBut.Edge._upath = "foo";
em.print("after: Edge = {any}\n", .{AppBut.Edge});
em.print("after: Edge._upath = {s}\n", .{AppBut.Edge._upath});
output is as follows:
debug: AppBut = em.core.em.lang.em.unitScope_H(em.core.em.utils.ButtonT.em.em__generateS("ti.distro.cc23xx/BoardC__AppBut"[0..31]))
debug: before: Edge = em.core.em.lang.em.Proxy_H(em.core.em.lang.em.unitScope_H(em.core.em.hal.GpioEdgeI.em)){ ._upath = { 101, 109, 46, 104, 97, 108, 47, 71, 112, 105, 111, 69, 100, 103, 101, 73 } }
debug: before: Edge._upath = em.hal/GpioEdgeI
debug: after: Edge = em.core.em.lang.em.Proxy_H(em.core.em.lang.em.unitScope_H(em.core.em.hal.GpioEdgeI.em)){ ._upath = { 102, 111, 111 } }
debug: after: Edge._upath = em.hal/GpioEdgeI
suffice it to say that AppBut.Edge
is a struct with a single field named _upath
of type []const u8
…; AppBut
itself is a comptime struct
returned by a generator function… [[ sorry again for the added layers of complexity ]]
the snip above assigns AppBut.Edge._upath = "foo"
, with the state of the struct printed before/after the assignment…
what i can’t understand is WHY the 4rd print output shows “foo” { 102, 111, 111 }
as the current ._upath
value, whereas the 5th print output shows the original (string-formatted) value of this field (which was “em.hal/GpioEdgeI”)…
oddly enough, i have a method defined on @TypeOf(AppBut.Edge)
that actually DOES see the updated value of ._upath
when invoked later on; it’s only when i attempt to select ._upath
from the outside that i see what in fact was the ORIGINAL value of this field…
i realize the “fog” of my codebase can be a challenge here, and we’re operating somewhat in the abstract… any insights into WHAT circumstances in general could cause this anomaly might turn on a light for me