Skip to content

Scala 2.13.2

Compare
Choose a tag to compare
@SethTisue SethTisue released this 23 Apr 04:25
· 4952 commits to 2.13.x since this release
v2.13.2

Scala 2.13.2 has:

  • a brand-new Vector implementation
  • configurable warnings
  • an improved REPL (now JLine 3 based)
  • bugfixes and more

Vector

  • Rewrite Vector (using "radix-balanced finger tree vectors"), for performance (#8534)

Small vectors are now more compactly represented. Some operations are now drastically faster on large vectors. A few operations may be a little slower.

Kudos to @szeiger for this work.

Configurable warnings

  • Add -Wconf flag for configurable warnings, @nowarn annotation for local suppression (#8373)

Note that scala-collection-compat 2.1.6 (or newer) provides @nowarn for cross-built projects (as a no-op on 2.11 and 2.12).

Special thanks to Roman Janusz (@ghik), whose silencer plugin was the basis for this work.

REPL improvements

  • REPL: upgrade to JLine 3 (benefits include multi-line editing) (#8036)
  • Default true -Yrepl-class-based and -Yuse-magic-imports (#8748)
    • -Yrepl-class-based avoids deadlocks
    • -Yuse-magic-imports improves performance for long sessions
  • Improve REPL display of method types (#8319)

Special thanks to @som-snytt for spearheading the JLine 3 upgrade.

We are tracking JLine-related improvements and regressions here. There some known regressions in some less-vital features and behaviors; we plan to address these in future 2.13.x releases.

Language changes

  • Unicode escapes are now ordinary escape sequences (not processed early) (#8282)

Compiler fixes

  • Plug many variance holes (in higher-kinded types, refined types, and private inner classes) (#8545)
  • Fix variance handling for parameterized type aliases (#8651)
  • Exclude universal members (getClass, toString, etc) from root module import (#8541)
  • Matching strings makes switches in bytecode (#8451)

Deprecations

  • Deprecate eta-expansion, via trailing underscore, of methods with no argument lists (#8836)
  • Deprecate nested class shadowing in "override" position (#8705)
  • Deprecate numeric conversions that lose precision (e.g., Long to Double) (#8679)
  • Deprecate numeric widening of numeric literals which are not representable with Float/Double (#8757)
  • Deprecate old-style constructor syntax (#8591)

Improvements from the future

  • There is no more -Xsource:2.14, only -Xsource:3 (#8812)
  • Allow infix operators at start of line (under -Xsource:3) (#8419)
  • Case class copy and apply inherit access modifiers from constructor (under -Xsource:3) (#7702)

Other fixes and improvements

  • Un-deprecate default floating point Orderings; issue migration warning instead under -Xmigration (#8721)
  • Support macro annotation expansions in -Wmacros:MODE (#8799)
  • Scaladoc can now link to Javadoc for the Java standard library for JDK versions 9 and up (overridable with new -jdk-api-doc-base flag) (#8663)
  • sys.env now throws on null environment variable (#8579)
  • Make the hashcode method ## have no parameter list (instead of a single empty one) (#8814)

This is not a complete list of changes. For that, see all merged PRs and all closed bugs.

2.13.2 also includes the changes in Scala 2.12.11, most notably:

  • Make optimizer work on JDK 13+ (#8676).

Compatibility

As usual for our minor releases, Scala 2.13.2 is binary-compatible with the whole Scala 2.13 series.

Upgrading from 2.12? Enable -Xmigration while upgrading to request migration advice from the compiler.

Contributors

A big thank you to everyone who's helped improve Scala by reporting bugs, improving our documentation, spreading kindness in discussions around Scala, and submitting and reviewing pull requests! You are all magnificent.

This release was brought to you by 45 contributors, according to git shortlog -sn --no-merges HEAD ^v2.13.1 ^2.12.x. Thank you Som Snytt, Jason Zaugg, Lukas Rytz, Dale Wijnand, Seth Tisue, Diego E. Alonso Blas, Georgi Krastev, Martijn Hoekstra, Eugene Yokota, Harrison Houghton, Stefan Zeiger, NthPortal, Anatolii, Linas Medžiūnas, Aaron S. Hawley, Guillaume Martres, Josh Lemer, Sébastien Doeraene, Jasper Moeys, Julien Truffaut, Oskar Haarklou Veileborg, Lucas Cardoso, Andrew Valencik, Adriaan Moors, yudedako, Steven Barnes, Brian Wignall, Ausmarton Zarino Fernandes, Oguz Albayrak, Philippus, Viktor Klang, Yang Bo, bnyu, psilospore, sinanspd, wholock, Jamie Thompson, Hamza Meknassi, Janek Bogucki, Flash Sheridan, Fabian Page, Kenji Yoshida, Denis Rosset, Lucas S Cardoso, Chris Birchall.

Thanks to Lightbend for their continued sponsorship of the Scala core team’s efforts. Lightbend offers commercial support for Scala.

Scala 2.13 notes

The release notes for Scala 2.13.0 have important information applicable to the whole 2.13 series.

Obtaining Scala

Scala releases are available through a variety of channels, including (but not limited to):