-
Notifications
You must be signed in to change notification settings - Fork 824
Fix import elision with type-only usage #2646
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
Changes from all commits
a92014d
af21080
d45ec2b
c27b95b
2c64cc5
d3ac5f3
2581d1b
e624128
3a0ebb7
400d9cd
df2e210
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
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.
The PR description says the fix is to elide imports even when
isElisionBlockedis true only when the visitedImportClausebecomes nil, but the implementation removes theisElisionBlockedgate for allImportDeclarations. This changes behavior for any import declaration that was modified earlier in the pipeline (including by custombeforetransforms) and may re-enable elision in cases theisElisionBlockedcontract is meant to prevent. Consider restoring theisElisionBlockedcheck for the general case and only bypassing it for the specific scenario where the visitedImportClausebecomes nil (or adjustisElisionBlockedto treat TypeEraser updates as non-blocking).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.
The PR description was not updated to reflect the later changes, unfortunately
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.
isElisionBlockedseems to only be needed for custom transformers, which we don't have, too.