Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PartialEq for all write types? #532

Closed
rsheeter opened this issue Jul 5, 2023 · 5 comments · Fixed by #533
Closed

PartialEq for all write types? #532

rsheeter opened this issue Jul 5, 2023 · 5 comments · Fixed by #533

Comments

@rsheeter
Copy link
Collaborator

rsheeter commented Jul 5, 2023

It would be helpful for the compiler to be able to check if an instance of a write type changed using == but the types don't consistently implement partialeq. Maybe write-types should just always have Capability::Equality?

Context googlefonts/fontc#359 (comment)

@cmyr
Copy link
Member

cmyr commented Jul 6, 2023

Yea, I think this makes sense. Do we also want to add Ord/Hash?

@cmyr
Copy link
Member

cmyr commented Jul 6, 2023

if we add them all then I can delete some codegen code, and there isn't a ton of downside; maybe slightly slower compilation, but the compiled code should get stripped if it's unused

@cmyr
Copy link
Member

cmyr commented Jul 6, 2023

I'm going to go ahead and try that, I think it'll save us future headaches.

@rsheeter
Copy link
Collaborator Author

rsheeter commented Jul 6, 2023

I don't find it as obvious that Ord and Hash make sense for everything?

@cmyr
Copy link
Member

cmyr commented Jul 10, 2023

They're necessary if we ever want to put any of these types in a set. Overall none of these traits are 'always necessary', but we don't have perfect foresight of when they will be necessary, and the alternative (some ability to add them as needed in codegen) is more complicated and more work overall.

@cmyr cmyr closed this as completed in #533 Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants