diff options
author | Martin Odersky <odersky@gmail.com> | 2015-06-19 10:25:35 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-06-19 10:28:02 +0200 |
commit | 0ec9c927941ab3155d0c5edacfe3a21c8c4b74ca (patch) | |
tree | cd5e0c1cee095ddaa595fc8291af8b62c6958e17 /tests/pending | |
parent | 78fae1152a7b381af4639d3d66ed637eac3ca9d0 (diff) | |
download | dotty-0ec9c927941ab3155d0c5edacfe3a21c8c4b74ca.tar.gz dotty-0ec9c927941ab3155d0c5edacfe3a21c8c4b74ca.tar.bz2 dotty-0ec9c927941ab3155d0c5edacfe3a21c8c4b74ca.zip |
Fix checking whether types are instantiable.
The logic for checking aginst the self type was wrong, as demonstrated
by pos/checkInstantiable.scala.
Diffstat (limited to 'tests/pending')
-rw-r--r-- | tests/pending/run/collections.check | 42 | ||||
-rw-r--r-- | tests/pending/run/collections.scala | 119 |
2 files changed, 0 insertions, 161 deletions
diff --git a/tests/pending/run/collections.check b/tests/pending/run/collections.check deleted file mode 100644 index c24150b24..000000000 --- a/tests/pending/run/collections.check +++ /dev/null @@ -1,42 +0,0 @@ -***** mutable.HashSet: -test1: 14005 -test2: 25005003, iters = 5000 -test3: 25005003 -***** mutable.LinkedHashSet: -test1: 14005 -test2: 25005003, iters = 5000 -test3: 25005003 -***** immutable.Set: -test1: 14005 -test2: 25005003, iters = 5000 -test3: 25005003 -***** immutable.ListSet: -test1: 14005 -test2: 25005003, iters = 5000 -test3: 25005003 -***** immutable.TreeSet: -test1: 14005 -test2: 25005003, iters = 5000 -test3: 25005003 -***** mutable.HashMap: -test1: 14005 -test2: 25005003, iters = 5000 -test3: 25005003 -***** mutable.LinkedHashMap: -test1: 14005 -test2: 25005003, iters = 5000 -test3: 25005003 -***** immutable.Map: -test1: 14005 -test2: 25005003, iters = 5000 -test3: 25005003 -test4: 25005003 -***** immutable.TreeMap: -test1: 14005 -test2: 25005003, iters = 5000 -test3: 25005003 -test4: 25005003 -***** immutable.ListMap: -test1: 14005 -test2: 9007003, iters = 3000 -test3: 9007003 diff --git a/tests/pending/run/collections.scala b/tests/pending/run/collections.scala deleted file mode 100644 index acc2d93ff..000000000 --- a/tests/pending/run/collections.scala +++ /dev/null @@ -1,119 +0,0 @@ -import scala.collection._ -import scala.compat.Platform.currentTime -import scala.language.postfixOps - -object Test extends dotty.runtime.LegacyApp { - - val printTime = false - - def sum[A](xs: Iterable[Int]) = (0 /: xs)((x, y) => x + y) - - def time(op: => Unit): Unit = { - val start = currentTime - op - if (printTime) println(" time = "+(currentTime - start)+"ms") - } - - def test(msg: String, s0: collection.immutable.Set[Int], iters: Int) = { - println("***** "+msg+":") - var s = s0 - s = s + 2 - s = s + (3, 4000, 10000) - println("test1: "+sum(s)) - time { - s = s ++ (List.range(0, iters) map (2*)) - println("test2: "+sum(s)+", iters = "+iters) - } - time { - var x = 0 - for (i <- 0 to 10000) - if (s contains i) x += i - println("test3: "+x) - } - } - - def test(msg: String, s0: collection.mutable.Set[Int], iters: Int) = { - println("***** "+msg+":") - var s = s0 - s = s + 2 - s = s + (3, 4000, 10000) - println("test1: "+sum(s)) - time { - s = s ++ (List.range(0, iters) map (2*)) - println("test2: "+sum(s)+", iters = "+iters) - } - time { - var x = 0 - for (i <- 0 to 10000) - if (s contains i) x += i - println("test3: "+x) - } - } - - def test(msg: String, s0: collection.immutable.Map[Int, Int], iters: Int) = { - println("***** "+msg+":") - var s = s0 - s = s + (2 -> 2) - s = s + (3 -> 3, 4000 -> 4000, 10000 -> 10000) - println("test1: "+sum(s map (_._2))) - time { - s = s ++ (List.range(0, iters) map (x => x * 2 -> x * 2)) - println("test2: "+sum(s map (_._2))+", iters = "+iters) - } - time { - var x = 0 - for (i <- 0 to 10000) - s get i match { - case Some(i) => x += i - case None => - } - println("test3: "+x) - } - if (iters == 5000) { - time { - var s1 = s - var x = 0 - for (i <- 0 to 10000) { - s get i match { - case Some(i) => x += i - case None => - } - s1 = s1 + ((i + 10000) -> i) - } - println("test4: "+x) - } - } - } - - def test(msg: String, s0: collection.mutable.Map[Int, Int], iters: Int) = { - println("***** "+msg+":") - var s = s0 - s = s + (2 -> 2) - s = s + (3 -> 3, 4000 -> 4000, 10000 -> 10000) - println("test1: "+sum(s map (_._2))) - time { - s = s ++ (List.range(0, iters) map (x => x * 2 -> x * 2)) - println("test2: "+sum(s map (_._2))+", iters = "+iters) - } - time { - var x = 0 - for (i <- 0 to 10000) - s get i match { - case Some(i) => x += i - case None => - } - println("test3: "+x) - } - } - - test("mutable.HashSet", new mutable.HashSet[Int], 5000) - test("mutable.LinkedHashSet", new mutable.LinkedHashSet[Int], 5000) - test("immutable.Set", immutable.Set[Int](), 5000) - test("immutable.ListSet", new immutable.ListSet[Int], 5000) - test("immutable.TreeSet", new immutable.TreeSet[Int], 5000) - test("mutable.HashMap", new mutable.HashMap[Int, Int], 5000) - test("mutable.LinkedHashMap", new mutable.LinkedHashMap[Int, Int], 5000) - test("immutable.Map", immutable.Map[Int, Int](), 5000) - test("immutable.TreeMap", new immutable.TreeMap[Int, Int], 5000) - test("immutable.ListMap", new immutable.ListMap[Int, Int], 3000) -} |