diff options
author | Simon Ochsenreither <simon@ochsenreither.de> | 2013-04-23 17:15:33 +0200 |
---|---|---|
committer | Simon Ochsenreither <simon@ochsenreither.de> | 2013-04-24 16:55:12 +0200 |
commit | 372965b1b4950c41c66c946ddb0ee47698e0740a (patch) | |
tree | 295165919fbac9d2128d87ab0dd8756bc182c60a /src/library | |
parent | 5ec9dbd6a983778b3765d2da36b208081896ad8e (diff) | |
download | scala-372965b1b4950c41c66c946ddb0ee47698e0740a.tar.gz scala-372965b1b4950c41c66c946ddb0ee47698e0740a.tar.bz2 scala-372965b1b4950c41c66c946ddb0ee47698e0740a.zip |
SI-7402 List extends Serializable
While we are all aware of the issues around Serialization,
I think in this case it is perfectly sound and safe to make
List serializable:
- List is not an interface, it is the base type of an ADT.
Common behavior of its members should be reflected in the base type.
- List is sealed, there is no chance of an user providing a new
non-serializable subtype of List.
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/collection/immutable/List.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/library/scala/collection/immutable/List.scala b/src/library/scala/collection/immutable/List.scala index be233d06cb..f3559f7d26 100644 --- a/src/library/scala/collection/immutable/List.scala +++ b/src/library/scala/collection/immutable/List.scala @@ -85,7 +85,8 @@ sealed abstract class List[+A] extends AbstractSeq[A] with LinearSeq[A] with Product with GenericTraversableTemplate[A, List] - with LinearSeqOptimized[A, List[A]] { + with LinearSeqOptimized[A, List[A]] + with Serializable { override def companion: GenericCompanion[List] = List import scala.collection.{Iterable, Traversable, Seq, IndexedSeq} |