Closed cjdrake closed 5 months ago
The code for struct field getter only works for Enum/Vec:
def _fget(name, cls, self): n = getattr(self, f"_{name}_size") nbits = _ITEM_BITS * n mask = (1 << nbits) - 1 i = getattr(self, f"_{name}_base") data = (self._data >> (_ITEM_BITS * i)) & mask return cls(data)
This missing piece is the ability to cast data directly into a Struct. Using the constructor (as is) won't work.
data
The code for struct field getter only works for Enum/Vec:
This missing piece is the ability to cast
data
directly into a Struct. Using the constructor (as is) won't work.