-
-
Notifications
You must be signed in to change notification settings - Fork 231
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 multiple time imports using reference variables #663
Conversation
Referencing to types is not safe (generics, type constraint). How about referring to upd: At second look this idea is not so good, for example |
9bf6046
to
443911e
Compare
Right, you could always have a package which doesn't export any names, if it were imported like FWIW I think any exported name works except generic types. For regular types, use |
Relying on |
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.
Looks good - some thoughts to polish this up.
Alternate realization of fix.
Сurrent version redesigns logic for handling unnecessary (after shrink runtime or literals).
Now instead of renaming unnecessary imports, it creates global unnamed variables referencing to declaration inside unused import (note: go/types returns sorted decl's)
If decl is constant, variable or function:
If decl is type (struct, type, interface, etc...):
Fix: #658