For the following code:
def foo(s: java.io.Serializable): java.lang.Object = s
It is compiled okay under scala 2.9.3. But got the following error under scala 2.10.4
scala> def foo(s: java.io.Serializable): java.lang.Object = s
<console>:7: error: type mismatch;
found : java.io.Serializable
required: Object
Note that Serializable extends Any, not AnyRef.
Such types can participate in value classes, but instances
cannot appear in singleton types or in reference comparisons.
def foo(s: java.io.Serializable): java.lang.Object = s
^
I did notice this commit adds the "Any" to scala Serializable trait and think it does have impact for the above error.
-trait Serializable extends java.io.Serializable
+trait Serializable extends Any with java.io.Serializable
But I am confused why this is making a difference.