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
Change Seq alias from collection.Seq to collection.immutable.Seq #6570
Comments
Imported From: https://issues.scala-lang.org/browse/SI-6570?orig=1 |
@viktorklang said: In predef: type Map[A, +B] = immutable.Map[A, B] exercise for the reader: type Seq[A] = ??? |
@SethTisue said: |
@odersky said: |
@hseeberger said: type Traversable[+A] = scala.collection.immutable.Traversable[A] type Iterable[+A] = scala.collection.immutable.Iterable[A] type IndexedSeq[+A] = scala.collection.immutable.IndexedSeq[A] |
@densh said: |
Jeff Shaw (shawjef3) said (edited on Dec 2, 2014 3:53:56 AM UTC): If we must have Seq methods available to vararg values, an implicit conversion from scala.Array to mutable.Seq would be enough. |
@SethTisue said: |
This. Is. Happening. scala/collection-strawman#149 |
Seq pointing to collection.Seq is very dangerous, because it enables mutability leaking into an otherwise immutable API. It is very dangerous, because the "Scala story" is that all collections that one can use without import are immutable. Even very experienced developers don't know or simply forget that Seq just aliases collection.Seq, which means one could easily pass a mutable Seq or Array for a parameter annotated with Seq.
See the scala-internal mailing list for more details ...
The text was updated successfully, but these errors were encountered: