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