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

Add more functionality to get_custom_type_aliases sorting #2088

Merged
merged 1 commit into from
May 3, 2024

Conversation

giarc3
Copy link
Contributor

@giarc3 giarc3 commented May 1, 2024

I tried to consume the change from #2075 today and noticed that it didn't cover my use case, where a type alias is used as the key for a HashMap which also is an alias. I added a test showing this and made a change to the sorting algorithm to fix this.

The current algorithm for ordering type aliases is: "if the typename I'm inserting into the sorted list is the type for something already in the list, put this item in front of it".

My proposed new algorithm is: "if the typename I'm inserting into the sorted list is included in the nested types for something already in the list, put this item in front of it".

@giarc3 giarc3 requested a review from a team as a code owner May 1, 2024 18:48
@giarc3 giarc3 requested review from mhammond and removed request for a team May 1, 2024 18:48
Copy link
Member

@mhammond mhammond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks - I feel like we are missing something simpler here that would also fix the problem in the comment too, but I still don't see it :)

@mhammond mhammond merged commit 9e61724 into mozilla:main May 3, 2024
5 checks passed
@skeet70 skeet70 mentioned this pull request May 13, 2024
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.

2 participants