From Programming Scala book I read that in following code configFilePath
constant will be type of Unit
:
scala> val configFilePath = if (configFile.exists()) {
| configFile.getAbsolutePath()
| }
configFilePath: Unit = ()
But when I execute this code in REPL I get result of type Any
. Why?
The book examples use Scala 2.8, and I use Scala 2.10.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…