I use Scala 2.9.1. I have a simple scala "interpreter":
import scala.tools.nsc.interpreter.IMain
import scala.tools.nsc.interpreter.Results.Result
import scala.tools.nsc.interpreter.Results.Success
object App {
def main(args: Array[String]) {
val interpreter = new IMain
val result:Result = interpreter.interpret(args(0))
result.toString() match {
case "Success" =>
{
var success = result.asInstanceOf[Success]
println(success.productElement(0))
};
case _ => println("very bad result");
}
}
}
When i try to compile it (maven) i get:
[ERROR] /home/koziolek/workspace/dsi/src/main/scala/pl/koziolekweb/scala/dsi/App.scala:15: error: not found: type Success
[INFO] var success = result.asInstanceOf[Success]
As you can see, the compiler said that there is no type Success, although I imported it.