Scala 2.11 Error Error:not found:type application

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.