This page is no longer maintained — Please continue to the home page at

Oddity trying to import members of an object?

No replies
Robin Barooah
Joined: 2008-12-21,
User offline. Last seen 3 years 27 weeks ago.
I've been having trouble importing the members of an object, which is something I do all the time.  It's entirely possible I've gone code-blind over the holidays, but this is really stumping me.
The source looks like this:
package {         object Query {                 abstract case class Expression {            //def query :String         }...
Which compiles fine. From the console (with the classpath set correctly by mvn scala:console), I do this:
scala> import import<console>:4: error: value Query is not a member of package        import                                          ^
scala> import   import
As you can see, my attempt to import the members of Query fails with "Query is not a member of package...", and yet my attempt to import Query itself succeeds, so there's clearly something there.
Am I missing something obvious here?
The full source of Query.scala is here: 

And you can reproduce the problem by doing:
git clone git:// broken cd brokenmvn compile scala:console
And then attempting the import.
Please tell me it's code blindness and I've missed something obvious!  Any insight gladly appreciated.

Robin Barooah

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland