Scala collections import weirdness

For some reason, the recent nightly builds of the Scala plugin now require collection imports to be qualified with "scala.collection".

Example:
import collection.generic.Addable

trait Foo extends Addable[Foo, Foo] {
    // etc etc
}

Now Addable shows up as red and the Scala plugin suggests importing "scala.collection.generic.Addable", even through the code compiles just fine.

Interestingly enough, other top-level imports, like "reflect.BeanInfo" (which is really scala.reflect.BeanInfo) don't have this annoying tic.

Have I misconfigured something with my Scala facet?  Does anyone else have this issue?

3 comments
Comment actions Permalink

Try:

import collection<cursor>._

CTRL-B

This should take you to the collection package.

If not, there is a chance you have a local variable or package in your own project in scope named 'collection', and you should browse to that point.

addable.png

0
Comment actions Permalink

Thanks, retronymster, that was exactly the case.  Someone added a com.test.whatever.collection package in a module that this module depends on - although it is strange that Idea should find the import ambiguous, because i am not importing com.test.whatever._ above.

0

Please sign in to leave a comment.