- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Case classes and the scala interpreter
Tue, 2009-01-06, 03:33
Hello,
I have a file called HttpServer.scala, which contains the following
code snippets:
--------------------------
package httpd
...
case class Incoming(socket: Socket, document_root:String)
--------------------------
I set my $classpath appropriately, and then import this file into a
Scala script which does the following:
...
import httpd.Incoming
...
And when I run:
'scala test.scala', I am told:
(fragment of test.scala):8: error: Incoming is not a member of httpd
import httpd.Incoming
If I compile everything statically using scalac, it all works.
Now, if I change that line of the source to:
import httpd._
Everything works as expected with the interpreter too.
I confess to being a Scala newbie, but this behaviour with case
classes is a bit unexpected. Am I doing something wrong?
- johnk