From 2cef1c58a54c996243fb85630cce841073c18650 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sun, 25 Oct 2009 03:56:13 +0000 Subject: Fix and test case for #2512, plus lots of time ... Fix and test case for #2512, plus lots of time expended tuning HashSet starting sizes and growth rate, with almost nothing to show for it (but I did determine that "shadowed" is constructed identically something like 10,000 times, so there is probably a cache to be had there.) --- test/files/run/bug2512.scala | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/files/run/bug2512.scala (limited to 'test/files') diff --git a/test/files/run/bug2512.scala b/test/files/run/bug2512.scala new file mode 100644 index 0000000000..514b26650f --- /dev/null +++ b/test/files/run/bug2512.scala @@ -0,0 +1,14 @@ +import scala.tools.nsc.util.HashSet + +object Test +{ + val runs = 10000 + class Bop + + def main(args: Array[String]): Unit = { + val set: HashSet[Bop] = new HashSet("Bop", 16) + (1 to runs).toList foreach (_ => set addEntry new Bop) + + assert(runs == set.size && set.size == set.iterator.length) + } +} -- cgit v1.2.3