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
traits Map and Set do not match mutable versions #5441
Comments
Imported From: https://issues.scala-lang.org/browse/SI-5441?orig=1 |
@axel22 said: |
@paulp said: |
@axel22 said: |
@paulp said: * The most common way to create a collection is to use the companion objects as factories.
* Of these, the three most common
* are [[scala.collection.immutable.Seq]], [[scala.collection.immutable.Set]], and [[scala.collection.immutable.Map]]. Their
* companion objects are all available
* as type aliases the either the [[scala]] package or in `scala.Predef`, and can be used
* like so:
* {{{
* scala> val seq = Seq(1,2,3,4,1)
* seq: Seq[Int] = List(1, 2, 3, 4, 1)
*
* scala> val set = Set(1,2,3,4,1)
* set: scala.collection.immutable.Set[Int] = Set(1, 2, 3, 4)
*
* scala> val map = Map(1 -> "one",2 -> "two", 3 -> "three",2 -> "too")
* map: scala.collection.immutable.Map[Int,java.lang.String] = Map((1,one), (2,too), (3,three))
* }}}
*
* It is also typical to use the [[scala.collection.immutable]] collections over those
* in [[scala.collection.mutable]]; The types aliased in the [[scala]] package and
* the `scala.Predef` object are the immutable versions. |
@paulp said: |
Felix Dietze (man) said (edited on Oct 24, 2012 12:29:50 PM UTC):
|
@paulp said: |
@JamesIry said: |
@retronym said: |
I'm wondering why collection.mutable.Seq can be of type Seq while mutable.Map and mutable.Set cannot be of type Map and Set. Is that the expected behavior or a Bug?
The text was updated successfully, but these errors were encountered: