今天发现2.10的repl下:cp命令 (设置classpatch)不能正常工作。2.9.x正常。
scala> :cp /data/tmp/demo/
Added '/data/tmp/demo'. Your new classpath is:
".:/data/tmp/demo"
Nothing to replay.
//虽然cp命令没报任何问题,但在import的时候不灵
scala> import test.A1
<console>:7: error: not found: value test
import test.A1
^
2.10.1仍存在此bug,很低级啊,看来每个大版本发布后没几个小版本fix bug是很不稳定的。
先用启动时的-cp参数替代了:
scala -cp /data/tmp/demo/
// work
scala> import test.A1
import test.A1
查了一下这个bug:https://issues.scala-lang.org/browse/SI-6502
早就有人报了,他们觉得优先级不高,一拖再拖,要到2.10.2修复,估计在急着修复其他bug。