Skip to content

fix: Preserve error order when deduplicating errors #3860

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

GrahamDennis
Copy link

Previously when deduplicating errors, the errors were first sorted and
then deduplicated. This lost the ordering of errors which can be useful
for understanding why a value is not compatible with a declaration.

Resolves #3859

Previously when deduplicating errors, the errors were first sorted and
then deduplicated. This lost the ordering of errors which can be useful
for understanding why a value is not compatible with a declaration.

Signed-off-by: Graham Dennis <[email protected]>
@GrahamDennis GrahamDennis requested a review from cueckoo as a code owner March 28, 2025 23:39
@GrahamDennis GrahamDennis force-pushed the gdennis/stable-error-sorting branch from d59ed35 to b57f45f Compare March 28, 2025 23:39
Signed-off-by: Graham Dennis <[email protected]>
@GrahamDennis GrahamDennis force-pushed the gdennis/stable-error-sorting branch from b57f45f to 6b80a11 Compare March 28, 2025 23:40
Signed-off-by: Graham Dennis <[email protected]>
@mvdan
Copy link
Member

mvdan commented Mar 29, 2025

Thanks for the patch! Unfortunately this seems to introduce quadratic behavior, which could be problematic as large configurations can run into thousands of errors.

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 this pull request may close these issues.

Cue error deduplication does not preserve order
2 participants