From:http://j-q-j.org/scala/scala-2-11-application-error.html
Learn Scala These two days, download the latest version of the official website 2.11, the book is using "Programming in Scala", see classes and objects, this chapter of the last piece of code
| 1 2 3 4 5 |
import ChecksumAccumulator.calculateobject FallWinterSpringSummer extends Application { for (season <- List("fall", "winter", "spring")) println( season + ": " calculate(season))} |
Scalac Fallwinterspringsummer.scala error is as follows
| 1 |
error: not found: type Application |
find the official Scala API, found the built-in application class, do not know where the error, the book's sample code is still compiled error.
Baidu Search not fruit, Fqgoogle finally found the results, the last found StackOverflow the explanation of the great God
http://stackoverflow.com/questions/26176509/why-does-2-11-1-fail-with-error-not-found-type-application
Had Application been deprecated from Scala 2.9, probably it had been deleted in Scala 2.11 (it still exists in Scala 2.10) E Ven though at the moment I can ' t "find proofs for", use App instead.
Proof found, this is the Scala 2.11 branch on GitHub which have only a and this is the 2.10which have and App.scala App.scala c6/> with a deprecated warning.
after the Scala 2.9 version deprecated application, the App class was enabled, and the following code was corrected .
| 1 2 3 4 5 |
import ChecksumAccumulator.calculateobject FallWinterSpringSummer extends App { for (season <- List("fall", "winter", "spring")) println( season + ": " calculate(season))} |
Still do not follow the fashion, good to download a 2.9 continue to engage.
Scala 2.11 Error Error:not found:type application