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

fix: Avoid import duplication on unresolved imports #3730

Merged
merged 2 commits into from
Dec 16, 2020

Conversation

slarse
Copy link
Collaborator

@slarse slarse commented Dec 15, 2020

Fix #3729

This is ready for review. As explained in #3729, the problem here is that unresolved imports and "regular" imports never compare equal, even if they are textually identical (which is what actually matters here), causing ImportCleaner to duplicate them. With this PR, imports computed by the ImportCleaner are only added to the CU if they are unequal to any existing imports, both in terms of object equality and textual equality.

@slarse slarse changed the title wip: fix: Fix bug causing unresolved imports to result in import duplication review: fix: Fix bug causing unresolved imports to result in import duplication Dec 15, 2020
@slarse slarse changed the title review: fix: Fix bug causing unresolved imports to result in import duplication review: fix: Avoid import duplication on unresolved imports Dec 15, 2020
@monperrus monperrus changed the title review: fix: Avoid import duplication on unresolved imports fix: Avoid import duplication on unresolved imports Dec 16, 2020
@monperrus monperrus merged commit c525fe3 into INRIA:master Dec 16, 2020
@monperrus
Copy link
Collaborator

Thanks a lot @slarse

@slarse slarse deleted the issue/3729-fix-duplicated-imports branch May 28, 2021 10:08
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.

bug: ImportCleaner duplicates unresolved imports
2 participants