Either
- Require that all declared fields are
const, or
- Add
const to each declared field (with a warning?) if not already declared so.
The advantage of doing this is that we get both an efficient hash code and an efficient equality (because of the === shortcut)
const on a field is only available in Julia 1.8 and later.