-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Canonicalize imported witness blocks on FacetValue #6458
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
Conversation
48e069c to
5a9efbb
Compare
chandlerc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG, and really nice test to isolate this!
Comment inline is just confirming my understanding, no change needed.
| CARBON_FATAL("Unhandled inst: {0}", inst); | ||
| } | ||
| } | ||
| llvm::sort(sortable, [](auto& lhs, auto& rhs) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expect that this is true, but figured I would check -- there can't be cases with the same specific interface IDs, and so this is a total order and not a partial order?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identical specifics should be deduplicated (as an example, see above SortAndDeduplicate(required_interfaces_, RequiredLess);). That should happen during construction, and at this point we shouldn't need to deduplicate.
The test has a more complete explanation of this; witnesses on the FacetValue must have a canonical ordering.