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
This would look like a regular field type annotation for exact sizes (i.e. a::UInt16), or like e.g. a:3::UInt16 for objects that want to store the lower 3 bits of an UInt16 and want to get that type back out when accessing the field.
Due to the nature of how these objects are stored internally, the types will need to be at least isbitstype, possibly even isprimitivetype, as it's unclear whether the padding potentially contained in an isbitstype is legal to observe (I suspect it isn't).
<: Signed types will need to be at least 2 bits in size, to store the sign bit.
The text was updated successfully, but these errors were encountered:
isprimitivetype is the simplest to implement, should be straightforward
immutable structs ought to be possible too, if I'm ok with lying to the compiler and having Expr(:new) outside of a constructor for an object
mutable structs (both outside of FieldFlags.jl and those defined by FieldFlags.jl) won't work, because the additional indirection for a.b.c = 3 won't be able to store the result of b.c = 3 back into a.
So only immutable things can be stored nested, which makes sense if you think about what these objects then tend to represent.
This would look like a regular field type annotation for exact sizes (i.e.
a::UInt16
), or like e.g.a:3::UInt16
for objects that want to store the lower 3 bits of an UInt16 and want to get that type back out when accessing the field.Due to the nature of how these objects are stored internally, the types will need to be at least
isbitstype
, possibly evenisprimitivetype
, as it's unclear whether the padding potentially contained in an isbitstype is legal to observe (I suspect it isn't).<: Signed
types will need to be at least 2 bits in size, to store the sign bit.The text was updated successfully, but these errors were encountered: