Unused imports warnings are wrong

I use Scala plugin version 0.4.833 and I noticed it still has problems with spotting unused imports correctly. Implicit definition or implicit object imports are treated as unused, if the imported objects are not used directly (and they almost never are, because they are implicit). This makes "remove unused imports" feature completely useless, because it breaks code.

I propose to never treat any import that imports at least one implicit object or def as unused, even when it is actually not used at all. If it is not required now it may still be put there on purpose, in case more implicits will be added later.

1 comment
Comment actions Permalink

That's a good idea, I've been meaning to implement this. Can you please open a feature request in YouTrack?

Mid term we would like to outsource unused symbol / import detection to Scalac, Alexander has started to prototype the integration.

0

Please sign in to leave a comment.