The deserialize function of the pointer block calls db.deserialize, where db is a block associated with the pointer's child type. If the child type is using type-defined attributes, a compile error will be raised since there is no deserialize function in the child type's DB, only attributes.
Solution
We're missing attribute-handling logic in the pointer block. In getty.deserialize, we have this to handle attributes:
if (comptime traits.has_attributes(T, db)) {
switch (@typeInfo(T)) {
.Struct => {
return try blocks.Struct.deserialize(allocator, T, deserializer, visitor);
},
.Union => {
return try blocks.Union.deserialize(allocator, T, deserializer, visitor);
},
else => @compileError("unexpected type cannot be deserialized using attributes"),
}
}
Something similar needs to be added to the pointer DB.
Description
Problem
The
deserialize
function of the pointer block callsdb.deserialize
, wheredb
is a block associated with the pointer's child type. If the child type is using type-defined attributes, a compile error will be raised since there is nodeserialize
function in the child type's DB, only attributes.Solution
We're missing attribute-handling logic in the pointer block. In
getty.deserialize
, we have this to handle attributes:Something similar needs to be added to the pointer DB.
How to Reproduce the Bug
Additional Context
Thanks to @Namek for coming across this bug and bringing it up in the Discord!