use _prototype_root decl everywhere

This commit is contained in:
Muki Kiboigo
2025-11-27 12:55:48 -08:00
parent 15dff342a6
commit 8ce8c7a0f3

View File

@@ -303,7 +303,7 @@ pub fn destroy(self: *Factory, value: anytype) void {
if (comptime IS_DEBUG) {
// We should always destroy from the leaf down.
if (@hasField(S, "_type") and @typeInfo(@TypeOf(value._type)) == .@"union") {
if (@hasDecl(S, "_prototype_root")) {
// A Event{._type == .generic} (or any other similar types)
// _should_ be destoyed directly. The _type = .generic is a pseudo
// child