summaryrefslogtreecommitdiff
path: root/test/files/run/t3667.scala
Commit message (Collapse)AuthorAgeFilesLines
* SI-6388 Remove first parts of deprecated @serializable annotationSimon Ochsenreither2012-10-081-35/+0
|
* Deprecated the @serializable annotation, introd...Lukas Rytz2010-11-301-0/+31
| | | | | | | | | | | | | | | | | | | 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 for #3667. no reviewLukas Rytz2010-08-231-0/+8
|
* close #3667.Lukas Rytz2010-08-051-0/+45
scala> def ser(o: AnyRef) = new java.io.ObjectOutputStream(new java.io.ByteArrayOutputStream()).writeObject(o) ser: (o: AnyRef)Unit scala> @serializable class Outer { | case class Inner(x: Int) | } defined class Outer scala> val o = new Outer o: Outer = Outer@34469729 scala> ser(new o.Inner(1)) scala> o.Inner // initialize the Inner$module field of o res1: o.Inner.type = Inner scala> ser(new o.Inner(1)) java.io.NotSerializableException: Outer$Inner$ review by extempore.