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
It is currently impossible to instantiate a recursive type because types are immutable, so you would have to have the type already created in order to pass it into its own construction.
Idea:
Have a global registry of named types
To use a type in its own definition, would use new sb.RecursiveType(typeName)
When the type is written, the name (or equivalent identifier) probably has to be written with the first instance, and then when it is repeated, it would refer to that identifier to specify what type to use.
Each value write buffer would need to keep track of the positions in which recursive types' values were written. If the value was already written, a pointer would be created to it. Otherwise, the value would have to be added to the set of pointers to fill in later.
The text was updated successfully, but these errors were encountered:
To fix issues where a recursive type's definition contains a REPEATED_TYPE pointing to a parent of the recursive type, REPEATED_TYPE should be avoided if writing a descendant of a recursive type where it would point to before the recursive type
It is currently impossible to instantiate a recursive type because types are immutable, so you would have to have the type already created in order to pass it into its own construction.
Idea:
new sb.RecursiveType(typeName)
Example:
When the type is written, the name (or equivalent identifier) probably has to be written with the first instance, and then when it is repeated, it would refer to that identifier to specify what type to use.
Each value write buffer would need to keep track of the positions in which recursive types' values were written. If the value was already written, a pointer would be created to it. Otherwise, the value would have to be added to the set of pointers to fill in later.
The text was updated successfully, but these errors were encountered: