diff options
author | Tiark Rompf <tiark.rompf@epfl.ch> | 2010-04-13 11:08:12 +0000 |
---|---|---|
committer | Tiark Rompf <tiark.rompf@epfl.ch> | 2010-04-13 11:08:12 +0000 |
commit | ea91456310736caed3064c117c5a72f515d59688 (patch) | |
tree | fe8cc9d9665f22eae5c6a81d8c557b25a168f41a /test/files/run | |
parent | 5055ee1d62cd486e50dc13ca9275be91ebb78cc5 (diff) | |
download | scala-ea91456310736caed3064c117c5a72f515d59688.tar.gz scala-ea91456310736caed3064c117c5a72f515d59688.tar.bz2 scala-ea91456310736caed3064c117c5a72f515d59688.zip |
closes #3241 and improves serialization of hash...
closes #3241 and improves serialization of hash tries. review by
community.
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t3241.check | 1 | ||||
-rw-r--r-- | test/files/run/t3241.scala | 23 |
2 files changed, 24 insertions, 0 deletions
diff --git a/test/files/run/t3241.check b/test/files/run/t3241.check new file mode 100644 index 0000000000..348ebd9491 --- /dev/null +++ b/test/files/run/t3241.check @@ -0,0 +1 @@ +done
\ No newline at end of file diff --git a/test/files/run/t3241.scala b/test/files/run/t3241.scala new file mode 100644 index 0000000000..40097a046f --- /dev/null +++ b/test/files/run/t3241.scala @@ -0,0 +1,23 @@ +object Test { + + def main(args : Array[String]) : Unit = { + recurse(Map(1->1, 2->2, 3->3, 4->4, 5->5, 6->6, 7->7)) + recurse(Set(1,2,3,4,5,6,7)) + println("done") + } + + def recurse(map: collection.immutable.Map[Int, Int]): Unit = { + if (!map.isEmpty) { + val x = map.keys.head + recurse(map - x) + } + } + + def recurse(set: collection.immutable.Set[Int]): Unit = { + if (!set.isEmpty) { + val x = set.toStream.head + recurse(set - x) + } + } + +} |