diff options
author | Paul Phillips <paulp@improving.org> | 2010-12-03 06:16:46 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-12-03 06:16:46 +0000 |
commit | 811c7f9ba664fcb339c09474af65fa4874f23543 (patch) | |
tree | f0e33e34ba419f7fba37d48b19cae74f1a709100 /test/files/run | |
parent | 715d95479e77b06dd65303886d2e0e70ddcf461f (diff) | |
download | scala-811c7f9ba664fcb339c09474af65fa4874f23543.tar.gz scala-811c7f9ba664fcb339c09474af65fa4874f23543.tar.bz2 scala-811c7f9ba664fcb339c09474af65fa4874f23543.zip |
Overrides immutable.{ Map, Set, Seq } to return...
Overrides immutable.{ Map, Set, Seq } to return self on
the corresponding toMap/toSet/toSeq. Closes #3953, review
by prokopec.
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/collections-toSelf.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/files/run/collections-toSelf.scala b/test/files/run/collections-toSelf.scala new file mode 100644 index 0000000000..02f1dd6a95 --- /dev/null +++ b/test/files/run/collections-toSelf.scala @@ -0,0 +1,11 @@ +object Test { + val map = Map(1 -> 2) + val set = Set(1, 2) + val seq = collection.immutable.Seq(1, 2) + + def main(args: Array[String]): Unit = { + assert(map.toMap eq map) + assert(set.toSet eq set) + assert(seq.toSeq eq seq) + } +} |