Pregunta

What are the Scala 2.10 vs. 2.9 incompatibilities and how to deal with them?

Especially core libraries, but any issues with popular libraries might be interesting.

Links to official documents are appreciated.

¿Fue útil?

Solución

Not sure if bugs count, howerer there's an issue with type inference and existential types that has now been fixed (but the fix has not yet been released, so the issue is still there in the current release 2.10.0)

It's SI-5330. In the description of the issue (and in the various comments),there are examples of code that used to compile in scala 2.9 and is now failing to compile in 2.10.

Otros consejos

Found a couple of those:

  • Default actor library is Akka

Migrate to Akka:

http://docs.scala-lang.org/overviews/core/actors-migration-guide.html

Or include the old one. E.g. using maven:

<dependency>
  <groupId>org.scala-lang</groupId>
  <artifactId>scala-actors</artifactId>
  <version>2.10.0</version>
</dependency>
  • Extending case classes result in a compliation error

Do not inherit from case classes. Use extractor pattern if you were using case classes for matching:

http://www.scala-lang.org/node/112

  • A few deprecated methods were removed from List including: -, --, first, sort ...

See:

http://www.scala-lang.org/api/current/index.html#scala.collection.immutable.List

http://www.scala-lang.org/api/2.9.2/index.html#scala.collection.immutable.List

I think that by and large they are not source code incompatible. Some differences do exist, particularly related to existentials and pattern matching -- some due to new bugs on 2.10.0, some due to old bugs on 2.9.2 that got fixed.

Of course, a lot of deprecated stuff got removed, but that should go without saying.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top