Skip to content

[codegen] support optional fields with different conditions #577

Open
@cmyr

Description

Currently the mechanism we use to support optional fields only supports versions, and assumes that a higher version of a table always contains all the fields of previous versions.

This breaks with post, where 3.0 has fewer fields than 2.0. In addition, there have been a few other instances where we have something like this; for instance in lookup subtables, the markFilteringSet exists conditionally on the appropriate bit being set in the lookup flags.

Overall this would give us more flexibility in codegen, and save us hand-writing code.

That's actually an interesting complication for codegen, this is the first time where we will have a lower version of a table (2.0) that has more fields than a higher version (3.0). We make a bunch of assumptions about fields only being added with versions, so I'll have to think about this some.

Originally posted by @cmyr in #576 (comment)

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions