[codegen] Always generate Eq/Ord/Hash where possible #533
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In write-fonts, we will generate these traits for all types.
In read-fonts, the situation is more nuanced. In the case of tables, derive is not an option, because tables in read-fonts wrap some chunk of bytes, but that chunk may contain trailing data that is not necessarily part of the table in question.
More generally, in read-fonts, the semantics of things like 'equality' are ambiguous. If a table contains an offset to subtable, should equality be based on the raw value of the offset, or based recursively on the contents of the child tables?
At some point we may wish to revisit this qusetion, but for now I am punting. We will derive extra traits in read-fonts, but only for records, and only when they contain only non-offset scalar values.
closes #532