Take the 2-minute tour ×

The title pretty much sums up my question.

The deprecation and removal of case class inheritance is a pretty new one, and I wonder which things got removed/substantially changed before that. I remember something about val in for loops and a different name for object as well as some requires keyword.

I would love to see code examples of how things were used/how they were replaced later, with an actual version when it happened and with a rationale why!

PS: One item per answer seems to be a good idea!

share|improve this question

closed as not constructive by Lukas Eder, Andrew Barber Apr 6 '13 at 10:03


Many syntax changes are listed in the appendix of the ScalaReference. –  Debilski Jul 25 '11 at 11:04

6 Answers 6

up vote 3 down vote accepted

It was possible in Scala 2.7 to declare things of type int (no capital "I"). Since Scala does not support the idea of primitive values and tries to be as consistent with everything as far as it can, this "feature" is deprecated.

share|improve this answer
Afaik most community members didn't like the fact that some types started with a lowercase and some with uppercase, they "standardized" around uppercase around 2.8 ... –  soc Jul 26 '11 at 7:46

Case class inheritance was a short-lived feature: It was introduced in 2.7, deprecated in 2.8/2.9 and finally removed in 2.10.


case class Foo(a: Int, b: Int)
case class Bar extends Foo(42, 43)

The problem was that the automatically supplied equality implementations didn't really work in the face of inheritance, therefore this feature was removed.

Removing case class inheritance has also a good effect: It will allow supplying better typed product*** methods by inheriting the concrete ProductN trait:

val f = Foo(1,2).productIterator
f: Iterator[Any] = non-empty iterator // < 2.10
f: Iterator[Int] = non-empty iterator // 2.10 with -Xexperimental
share|improve this answer

requires clause was deprecated in version 2.6.

trait A requires B {

is now written as:

trait A { self: B =>

I don't know the rationale behind this syntax change. I personally find the requires syntax a tad bit more readable.

share|improve this answer
I'm guessing here, that it didn't fit well with something like trait A extends B requires C with D and so on...You probably would need a lot of parenthesis there to make it clear what requires what and so on... –  agilesteel Jul 27 '11 at 10:12

I don't know all the details offhand, but there is an extremely detailed version history starting here:


Practically every item that went into every release is listed. Many have links to JIRA tickets.

It might take a while to mine this data, but I suspect most of what you are looking for is there. What you might not see in detail are the rationales for deprecation, but if a JIRA ticket is given or an indication of the feature is at least written down, a web search on that topic should lead to a discussion page and rationale.

share|improve this answer
There is also the "Scala language changes" page: scala-lang.org/node/43 What I'm looking for are some concrete examples and the rationale behind it... –  soc Jul 25 '11 at 9:57
This is a much better link then the one I put in my answer. I looked at a couple removed features (scala.compat.math and assertSame) and it does look like finding out the reasons for deprecation in many cases is going to be hard. So great idea soliciting input here! –  Ray Toal Jul 25 '11 at 14:56

The for comprehensions used the keyword "val" before each generator. The next Scala version will no longer have this, but, presently, the following deprecated syntax is still accepted:

for (val i <- 1 to 10) yield i

This was just deemed unnecessarily verbose.

share|improve this answer
This still works in 2.10.0.r25323-b20110719020429 ... –  soc Jul 25 '11 at 21:43
@soc I might be mistaken, of course. But I could swear I saw the commit removing that. Well, I might be mistaken. –  Daniel C. Sobral Jul 26 '11 at 0:01
I could swear I saw it too, that's why I'm wondering ... :-) –  soc Jul 26 '11 at 7:44

Class literals (different from classOf[]) were removed from the language, but I couldn't figure out how they looked like, but probably like their Java equivalent .class.

share|improve this answer
