<div>Note that different major releases of Scala 2 (e.g. Scala 2.11.x and Scala 2.12.x) are not binary compatible with each other. Scala 3 minor releases (e.g. 3.0.x and 3.1.x) follow a different compatibility model .</div><div></div><div></div><div>The regression was mitigated 2.12.0-RC2 (and the final release) by generating forwarder methods in classes that inherit concrete methods from traits, which unfortunately increases bytecode size while improving JVM startup performance.</div><div></div><div></div><div></div><div></div><div></div><div>scala sdk 2.12 download</div><div></div><div>Download:
https://t.co/ByShrQw4Tm </div><div></div><div></div><div>We recommend using sbt 0.13.13. Simply bump the scalaVersion setting in your existing project, or start a new project using sbt new scala/scala-seed.g8. We strongly recommend upgrading to sbt 0.13.13 for templating support using the new command, faster compilation, and much more.</div><div></div><div></div><div>Scala 2.12.0 is the result of merging over 500 pull requests out of about 600 received PRs. The contributions to 2.12.x over the last 2 years were split 64/32/4 between the Scala team at Lightbend (lrytz, retronym, adriaanm, SethTisue, szeiger), the community, and EPFL.</div><div></div><div></div><div>Except for the breaking changes listed below, code that compiles on 2.11.x without deprecation warnings should compile on 2.12.x, unless you use experimental APIs such as reflection. If you find incompatibilities that are not listed below, please file an issue.</div><div></div><div></div><div>The next sections introduce new features and breaking changes in Scala 2.12 in more detail. To understand more technicalities and review past discussions, you can also take a look at the full list of noteworthy pull request that went into this release.</div><div></div><div></div><div>Because Java 8 allows concrete methods in interfaces, Scala 2.12 is able to compile a trait to a single interface classfile. Before, a trait was represented as an interface and a class that held the method implementations (T$class.class).</div><div></div><div></div><div>The Scala 2.12 type checker accepts a function literal as a valid expression for any Single Abstract Method (SAM) type, in addition to the FunctionN types from standard library. This improves the experience of using libraries written for Java 8 from Scala code. Here is a REPL example using java.lang.Runnable:</div><div></div><div></div><div>The Java 8 compatibility module for Scala has received an overhaul for Scala 2.12. Even though interoperability of Java 8 SAMs and Scala functions is now baked into the language, this module provides additional convenience for working with Java 8 SAMs. Java 8 streams support was also added during the development cycle of Scala 2.12. Releases are available for both Scala 2.11 and Scala 2.12.</div><div></div><div></div><div>In Scala 2.11, the body of a lambda was in the apply method of the anonymous function class generated at compile time. The new lambda encoding in 2.12 lifts the lambda body into a method in the enclosing class. An invocation of the lambda therefore involves the enclosing class, which can cause deadlocks that did not happen before.</div><div></div><div></div><div></div><div></div><div></div><div></div><div>In order to improve source compatibility, overloading resolution has been adapted to prefer methods with Function-typed arguments over methods with parameters of SAM types. The following example is identical in Scala 2.11 and 2.12:</div><div></div><div></div><div>In Scala 2.11, the first alternative was chosen because it is the only applicable method. In Scala 2.12, both methods are applicable, therefore overloading resolution needs to pick the most specific alternative. The specification for type compatibility has been updated to consider SAM conversion, so that the first alternative is more specific.</div><div></div><div></div><div>Note that SAM conversion in overloading resolution is always considered, also if the argument expression is not a function literal (like in the example). This is unlike SAM conversions of expressions themselves; see the previous section. See also the discussion in scala-dev#158.</div><div></div><div></div><div>Type inference for val, and lazy val has been aligned with def, fixing assorted corner cases and inconsistencies (#5141 and #5294). Concretely, when computing the type of an overriding field, the type of the overridden field is used as the expected type. As a result, the inferred type of a val or lazy val may change in Scala 2.12.</div><div></div><div></div><div>PR #4794 changed the syntax trees for selections of statically accessible symbols. For example, a selection of Predef no longer has the shape q"scala.this.Predef" but simply q"scala.Predef". Macros and compiler plugins matching on the old tree shape need to be adjusted.</div><div></div><div></div><div>This release was brought to you by 12 contributors, according to git shortlog -sn --no-merges ^v2.13.11 ^2.12.x ^366ba2f. Thank you A. P. Marki, Lukas Rytz, Seth Tisue, Scala Steward, Michel Davit, Nicolas Stucki, Alex Leigh, Eugene Yokota, Georgi Krastev, Jamie Willis, Julien Richard-Foy, NthPortal.</div><div></div><div></div><div>This release was brought to you by 28 contributors, according to git shortlog -sn --no-merges ^v2.13.10 ^2.12.x. Thank you A. P. Marki, Lukas Rytz, Seth Tisue, Anselm von Wangenheim, Scala Steward, Liang Yan, Jamie Thompson, jxnu-liguobin, AminMal, Jason Zaugg, Kenji Yoshida, Rituraj, ashish, Chris Kipp, Dale Wijnand, Francesco Kriegel, Georgi Chochov, Goooler, João Costa, Kisaragi Marine, Rafał Sumisławski, Ruslans Tarasovs, Simon R, Sébastien Doeraene, Tomasz Godzik, Zhang Zhipeng, danarmak, hepin.p.</div><div></div><div></div><div>This release was brought to you by 6 contributors, according to git shortlog -sn --no-merges ^v2.12.17 ^2.11.x. Thank you Seth Tisue, Lukas Rytz, Scala Steward, A. P. Marki, Jason Zaugg, Philippus Baalman.</div><div></div><div></div><div>This release was brought to you by 6 contributors, according to git shortlog -sn --no-merges ^v2.13.9 ^2.12.x. Thank you A. P. Marki, Liang Yan, Seth Tisue, Antoine Parent, Luc Henninger, 梦境迷离.</div><div></div><div></div><div>This release was brought to you by 27 contributors, according to git shortlog -sn --no-merges ^v2.13.8 ^2.12.x. Thank you A. P. Marki, Lukas Rytz, Seth Tisue, Jamie Thompson, Sébastien Doeraene, Scala Steward, Georgi Krastev, Jason Zaugg, Philippus, Balys Anikevicius, Gilad Hoch, NthPortal, Zhang Zhipeng, Arman Bilge, Dale Wijnand, Dominik Helm, Eric Huang, Guillaume Martres, Harrison Houghton, Krzysztof Pado, Michał Pałka, Zeeshan Arif, counter2015, jxnu-liguobin, mcallisto, naveen, philwalk.</div><div></div><div></div><div>This release was brought to you by 7 contributors, according to git shortlog -sn --no-merges ^v2.12.16 ^2.11.x. Thank you Lukas Rytz, Seth Tisue, Sébastien Doeraene, A. P. Marki, Jason Zaugg, Scala Steward, Daniel Esik.</div><div></div><div></div><div>Scala 2.12.16 contains a regression that was discovered after the artifacts were published. Only mixed compilation of Scala and Java source files together is affected, and only when the Scala code contains references to certain nested classes in the Java sources. The problem manifests as a compile-time type error. Follow link for details and workarounds. We'll fix the problem in Scala 2.12.17 which we expect to release in a few months.</div><div></div><div></div><div>This release was brought to you by 18 contributors, according to git shortlog -sn --no-merges ^v2.12.15 ^2.11.x. Thank you Scala Steward, Seth Tisue, Lukas Rytz, Sébastien Doeraene, A. P. Marki, Daniel Le, Jason Zaugg, Guillaume Martres, Frank Thomas, Philippus, Daniela Sfregola, Dale Wijnand, Vadzim Marchanka, hepin.p, naferx, Fredrik Svensson, Štefan Jurčo, Georgi Krastev.</div><div></div><div></div><div>This release was brought to you by 8 contributors, according to git shortlog -sn --no-merges ^v2.13.7 ^2.12.x. Thank you A. P. Marki, Seth Tisue, Georgi Krastev, Jason Zaugg, Lukas Rytz, Martijn Hoekstra, Philippus Baalman, Chris Kipp.</div><div></div><div></div><div>This release was brought to you by 25 contributors, according to git shortlog -sn --no-merges ^v2.13.6 ^2.12.x. Thank you A. P. Marki, Lukas Rytz, Seth Tisue, Jason Zaugg, Jamie Thompson, NthPortal, Georgi Krastev, Guillaume Martres, Dale Wijnand, Martijn Hoekstra, Alec Theriault, Rafał Sumisławski, Matt Dziuban, Li Haoyi, Doug Roper, Sébastien Doeraene, VladKopanev, danicheg, dengziming, megri, nwk37011, Magnolia.K, 梦境迷离, Mathias, James Judd.</div><div></div><div></div><div>We (Lukas and I) propose to list it as a known issue in the 2.12.16 release notes, but not withdraw the release over it. Our reasoning is that the problem occurs at compile-time (far less pernicious than a runtime failure) and will only affect certain users with mixed Scala/Java codebases with a certain kind of Java code.</div><div></div><div></div><div>Currently in my BuildSettings.scala file I am using crossScalaVersion := Seq("2.12.11", "2.13.2"), and my scalaVersion := "2.13.2", Now when I do sbt compile, it compiles with 2.13.2 correctly without any issue. Now when I do + compile, first it compiles with 2.12.11, then with 2.13.2 and fails here. Now the reason why its failing with 2.13.2 on + compile is because I have some collection libraries and some other libraries which are supported in only 2.12.11 and not in 2.13.2, e.g if we look at this piece of code:</div><div></div><div></div><div>TraversableLike doesn't exist anymore in 2.13.2, also in some other files I face other issues for which classes are not supported in 2.13.2 anymore.I can update the code according to 2.13.2 standards and support libraries, whatever is alternative to above collection etc. But then + compile fails, i.e compilation with 2.12.11 fails, as those libraries won't exist in 2.12.11.</div><div></div><div></div><div>We would like to thank our many community contributors for their hard work and dedication, from kindly helping others on the forums, reporting bugs, helping us polish our documentation, to committing 32% of the changes that make up Scala 2.12! The Scala team at Lightbend (Adriaan, Jason, Lukas, Seth and Stefan) contributed 64% of the commits, and EPFL implemented the remaining 4%.</div><div></div><div></div><div>Scala 2.12 also ships with a powerful new optimizer! Many more (effectively) final methods, including those defined in objects and traits, are now inlined. As well, closure allocations, dead code and box/unbox pairs are eliminated more effectively. We're grateful to Miguel Garcia for his initial work on this new optimizer while at EPFL.</div><div></div><div></div><div>Code compiled on 2.12 requires a Java 8 runtime. Any modern build tool will work, but we recommend using sbt 0.13.13 for the best experience. Because Scala 2.12 maintains source compatibility with 2.11, cross-building for both 2.11 and 2.12 is a one-line change to most sbt-based projects. You may need to make some changes if you are using experimental features such as macros, or have not caught up with deprecation warnings.</div><div></div><div> df19127ead</div>