Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List is not Serializable, which is confusing for users and causes lub-computation to infer a type of 250 lines #7402

Closed
scabug opened this issue Apr 22, 2013 · 7 comments
Assignees
Labels
Milestone

Comments

@scabug
Copy link

scabug commented Apr 22, 2013

The issue is that Nil and :: implement Serializable by being a case class/object, but the sealed abstract class List does not.

This leads to huge types down the line:

List(List(), Vector())

... results in the following type:

List[scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]{def companion:
 scala.collection.generic.GenericCompanion[scala.collection.immutable.Seq with
 scala.collection.AbstractSeq{def dropRight(n: Int): scala.collection.immutable.Seq[Any] with
 scala.collection.AbstractSeq[Any]; def takeRight(n: Int): scala.collection.immutable.Seq[Any] with
 scala.collection.AbstractSeq[Any]; def drop(n: Int): scala.collection.immutable.Seq[Any] with
 scala.collection.AbstractSeq[Any]; def take(n: Int): scala.collection.immutable.Seq[Any] with
 scala.collection.AbstractSeq[Any]; def slice(from: Int,until: Int): scala.collection.immutable.Seq[Any]
 with scala.collection.AbstractSeq[Any]}]; def dropRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]{def
 companion: scala.collection.generic.GenericCompanion[scala.collection.immutable.Seq with
 scala.collection.AbstractSeq]; def dropRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]{def dropRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 takeRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def drop(n: Int): scala.collection.immutable.Seq[Nothing]
 with scala.collection.AbstractSeq[Nothing]; def take(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def slice(from:
 Int,until: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]};
 def takeRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]{def dropRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 takeRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def drop(n: Int): scala.collection.immutable.Seq[Nothing]
 with scala.collection.AbstractSeq[Nothing]; def take(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def slice(from:
 Int,until: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]};
 def drop(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]{def dropRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 takeRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def drop(n: Int): scala.collection.immutable.Seq[Nothing]
 with scala.collection.AbstractSeq[Nothing]; def take(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def slice(from:
 Int,until: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]};
 def take(n: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]
 {def dropRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def takeRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def drop(n:
 Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 take(n: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing];
 def slice(from: Int,until: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]}; def slice(from: Int,until: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]{def
 dropRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def takeRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def drop(n:
 Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 take(n: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing];
 def slice(from: Int,until: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]}; def splitAt(n: Int): (scala.collection.immutable.Seq[Nothing]
 with scala.collection.AbstractSeq[Nothing], scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing])}; def takeRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]{def
 companion: scala.collection.generic.GenericCompanion[scala.collection.immutable.Seq with
 scala.collection.AbstractSeq]; def dropRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]{def dropRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 takeRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def drop(n: Int): scala.collection.immutable.Seq[Nothing]
 with scala.collection.AbstractSeq[Nothing]; def take(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def slice(from:
 Int,until: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]};
 def takeRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]{def dropRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 takeRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def drop(n: Int): scala.collection.immutable.Seq[Nothing]
 with scala.collection.AbstractSeq[Nothing]; def take(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def slice(from:
 Int,until: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]};
 def drop(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]{def dropRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 takeRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def drop(n: Int): scala.collection.immutable.Seq[Nothing]
 with scala.collection.AbstractSeq[Nothing]; def take(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def slice(from:
 Int,until: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]};
 def take(n: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]
 {def dropRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def takeRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def drop(n:
 Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 take(n: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing];
 def slice(from: Int,until: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]}; def slice(from: Int,until: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]{def
 dropRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def takeRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def drop(n:
 Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 take(n: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing];
 def slice(from: Int,until: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]}; def splitAt(n: Int): (scala.collection.immutable.Seq[Nothing]
 with scala.collection.AbstractSeq[Nothing], scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing])}; def drop(n: Int): scala.collection.immutable.Seq[Nothing]
 with scala.collection.AbstractSeq[Nothing]{def companion:
 scala.collection.generic.GenericCompanion[scala.collection.immutable.Seq with
 scala.collection.AbstractSeq]; def dropRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]{def dropRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 takeRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def drop(n: Int): scala.collection.immutable.Seq[Nothing]
 with scala.collection.AbstractSeq[Nothing]; def take(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def slice(from:
 Int,until: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]};
 def takeRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]{def dropRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 takeRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def drop(n: Int): scala.collection.immutable.Seq[Nothing]
 with scala.collection.AbstractSeq[Nothing]; def take(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def slice(from:
 Int,until: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]};
 def drop(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]{def dropRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 takeRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def drop(n: Int): scala.collection.immutable.Seq[Nothing]
 with scala.collection.AbstractSeq[Nothing]; def take(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def slice(from:
 Int,until: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]};
 def take(n: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]
 {def dropRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def takeRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def drop(n:
 Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 take(n: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing];
 def slice(from: Int,until: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]}; def slice(from: Int,until: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]{def
 dropRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def takeRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def drop(n:
 Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 take(n: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing];
 def slice(from: Int,until: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]}; def splitAt(n: Int): (scala.collection.immutable.Seq[Nothing]
 with scala.collection.AbstractSeq[Nothing], scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing])}; def take(n: Int): scala.collection.immutable.Seq[Nothing]
 with scala.collection.AbstractSeq[Nothing]{def companion:
 scala.collection.generic.GenericCompanion[scala.collection.immutable.Seq with
 scala.collection.AbstractSeq]; def dropRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]{def dropRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 takeRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def drop(n: Int): scala.collection.immutable.Seq[Nothing]
 with scala.collection.AbstractSeq[Nothing]; def take(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def slice(from:
 Int,until: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]};
 def takeRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]{def dropRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 takeRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def drop(n: Int): scala.collection.immutable.Seq[Nothing]
 with scala.collection.AbstractSeq[Nothing]; def take(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def slice(from:
 Int,until: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]};
 def drop(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]{def dropRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 takeRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def drop(n: Int): scala.collection.immutable.Seq[Nothing]
 with scala.collection.AbstractSeq[Nothing]; def take(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def slice(from:
 Int,until: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]};
 def take(n: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]
 {def dropRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def takeRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def drop(n:
 Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 take(n: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing];
 def slice(from: Int,until: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]}; def slice(from: Int,until: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]{def
 dropRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def takeRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def drop(n:
 Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 take(n: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing];
 def slice(from: Int,until: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]}; def splitAt(n: Int): (scala.collection.immutable.Seq[Nothing]
 with scala.collection.AbstractSeq[Nothing], scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing])}; def slice(from: Int,until: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]{def
 companion: scala.collection.generic.GenericCompanion[scala.collection.immutable.Seq with
 scala.collection.AbstractSeq]; def dropRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]{def dropRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 takeRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def drop(n: Int): scala.collection.immutable.Seq[Nothing]
 with scala.collection.AbstractSeq[Nothing]; def take(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def slice(from:
 Int,until: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]};
 def takeRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]{def dropRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 takeRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def drop(n: Int): scala.collection.immutable.Seq[Nothing]
 with scala.collection.AbstractSeq[Nothing]; def take(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def slice(from:
 Int,until: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]};
 def drop(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]{def dropRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 takeRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def drop(n: Int): scala.collection.immutable.Seq[Nothing]
 with scala.collection.AbstractSeq[Nothing]; def take(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def slice(from:
 Int,until: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]};
 def take(n: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]
 {def dropRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def takeRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def drop(n:
 Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 take(n: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing];
 def slice(from: Int,until: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]}; def slice(from: Int,until: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]{def
 dropRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def takeRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def drop(n:
 Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 take(n: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing];
 def slice(from: Int,until: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]}; def splitAt(n: Int): (scala.collection.immutable.Seq[Nothing]
 with scala.collection.AbstractSeq[Nothing], scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing])}; def splitAt(n: Int):
 (scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]{def
 dropRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def takeRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def drop(n:
 Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 take(n: Int): scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing];
 def slice(from: Int,until: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]}, scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]{def dropRight(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def
 takeRight(n: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]; def drop(n: Int): scala.collection.immutable.Seq[Nothing]
 with scala.collection.AbstractSeq[Nothing]; def take(n: Int):
 scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing]; def slice(from:
 Int,until: Int): scala.collection.immutable.Seq[Nothing] with
 scala.collection.AbstractSeq[Nothing]})}]

Making List implement Serializable:

List[scala.collection.immutable.Seq[Nothing] with scala.collection.AbstractSeq[Nothing] with java.io.Serializable]

While we are all aware of the issues around Serializable, 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.
@scabug
Copy link
Author

scabug commented Apr 22, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7402?orig=1
Reporter: @soc
Affected Versions: 2.10.1, 2.11.0-M2

@scabug
Copy link
Author

scabug commented Apr 22, 2013

@retronym said:
It would be beneficial to link to the discussions on the mailing list that preceded the ticket.

@scabug
Copy link
Author

scabug commented Apr 22, 2013

@scabug
Copy link
Author

scabug commented Apr 22, 2013

@adriaanm said:
I wouldn't say List's lacking Serializable as a parent results in the huge lub, but rather that adding it makes the lub easier to express. Another shared parent would surely also have done the trick.

@scabug
Copy link
Author

scabug commented Apr 22, 2013

@paulp said:
Yes, however this observation has been very useful. Watch out, lub code. I'm coming.

@scabug
Copy link
Author

scabug commented Apr 26, 2013

@soc said:
Merged in scala/scala@44625e3.

@scabug scabug closed this as completed Apr 26, 2013
@scabug
Copy link
Author

scabug commented Mar 26, 2015

@lrytz said:
test in scala/scala#4409

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants