summaryrefslogtreecommitdiff
path: root/test/files/run/t6197.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-08-14 08:56:26 +0200
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-08-14 09:37:19 +0200
commit3ccaa1026e7e74d99fe39c9608e28c48b422e2c9 (patch)
treea1187b22900d5904f9ba6e5664440a8248491f5a /test/files/run/t6197.scala
parent48d9fb7307fb6519fe786a7d9be97996c5812fb7 (diff)
parent12baa2ea399b4f281c62fd20479c1e626f244d03 (diff)
downloadscala-3ccaa1026e7e74d99fe39c9608e28c48b422e2c9.tar.gz
scala-3ccaa1026e7e74d99fe39c9608e28c48b422e2c9.tar.bz2
scala-3ccaa1026e7e74d99fe39c9608e28c48b422e2c9.zip
Merge branch '2.10.x'
Conflicts: src/compiler/scala/tools/nsc/Global.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala test/files/neg/t6048.check
Diffstat (limited to 'test/files/run/t6197.scala')
-rw-r--r--test/files/run/t6197.scala21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/files/run/t6197.scala b/test/files/run/t6197.scala
new file mode 100644
index 0000000000..5ab4b002d7
--- /dev/null
+++ b/test/files/run/t6197.scala
@@ -0,0 +1,21 @@
+import scala.collection.immutable._
+
+object Test extends App {
+
+ // test that a HashTrieSet with one leaf element is not created!
+ val x = HashSet.empty + 1 + 2
+ if(x.getClass.getSimpleName != "HashTrieSet")
+ println("A hash set containing two non-colliding values should be a HashTrieSet")
+
+ val y = x - 1
+ if(y.getClass.getSimpleName != "HashSet1")
+ println("A hash set containing one element should always use HashSet1")
+
+ // it is pretty hard to test that the case where a HashTrieSet has one element which
+ // is itself of type HashTrieS t. That is because the improve hash function makes it very difficult
+ // to find keys that will have hashes that are close together.
+ //
+ // However, it is also not necessary. Removing the ability of a HashTrieSet to have
+ // one child of type HashTrieSet completely breaks the HashSet, so that many other
+ // tests fail
+}