Explicit nested struct serialization options #1050
Labels
feature: structs
Structures and messages (struct Foo, message Foo)
kind: discussion
Ideas that are not fully formed and require discussion
kind: language feature
Intent to add a language feature
Milestone
Currently, the compiler automatically determines whether to serialize a nested struct inlined in the same cell or as a reference, based on whether it fits. This proposal introduces a way for developers to explicitly specify the desired serialization mode.
For example:
With this feature:
c
will always be serialized in the same cell asA
, whiled
will always be serialized as a reference, regardless of their sizes.If the specified serialization mode is not feasible (e.g., a large struct is forced as
inline
but cannot fit in the cell), the compiler will throw a compilation error.The text was updated successfully, but these errors were encountered: