From 4be5e11cccace4974ed9a449052455392570139f Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Tue, 30 Nov 2010 15:38:56 +0000 Subject: Deprecated the @serializable annotation, introd... Deprecated the @serializable annotation, introduce a new trait "scala.Serializable" which has to be extended instead (cross-platform). Known issues: - Companion objects of serializable classes (including case classes) are automatically made serializable. However, they don't extend "Serializable" statically because of the known difficulty (should be done before typing, but hard). - Writing "case class C() extends Serializable" gives "error: trait Serializable is inherited twice" - Functions are serializable, but don't extend Serializable dynamically (could be fixed by making FunctionN Serializable - shouldn't we?) Note that @SerialVersionUID continues to be an annotation; it generates a static field, which is not possible otherwise in scala. Review by dragos, extempore. Question to dragos: in JavaPlatform.isMaybeBoxed, why is there a test for "JavaSerializableClass"? Is that correct? --- test/files/pos/t3924.scala | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 test/files/pos/t3924.scala (limited to 'test/files/pos/t3924.scala') diff --git a/test/files/pos/t3924.scala b/test/files/pos/t3924.scala new file mode 100644 index 0000000000..35165baaf0 --- /dev/null +++ b/test/files/pos/t3924.scala @@ -0,0 +1,6 @@ +object Test { + class Hoe extends Serializable { + def add(a: java.io.Serializable): Unit = println(a) + def someMethod() { add(this) } + } +} -- cgit v1.2.3