If you create a file containing only this class definition:
class Optional(x: Int = 0)
Then compile it with Scala 2.9.2 and run javap in the resulting class, you will see the following:
public class Optional implements scala.ScalaObject { public static final int init$default$1(); public Optional(int); }
Compile it again with 2.10.0-RC2 and javap and you will get this instead:
public class Optional { public static int $lessinit$greater$default$1(); public Optional(int); }
So, no, the default arguments in version 2.10 are perfectly fine, you just came across a concrete example of the lack of binary compatibility between major versions of Scala.
source share