summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2012-08-20 08:10:34 +0100
committerGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2012-08-20 08:10:38 +0100
commitcf9b7ae0867f594aba39984ac732fbd26ed12f51 (patch)
tree3d4035fda41f8f2bd84361fbca312693c8d2b6f2 /test
parentc32b189a2a2575512d0dc8d91a400d773b53a7f0 (diff)
downloadscala-cf9b7ae0867f594aba39984ac732fbd26ed12f51.tar.gz
scala-cf9b7ae0867f594aba39984ac732fbd26ed12f51.tar.bz2
scala-cf9b7ae0867f594aba39984ac732fbd26ed12f51.zip
Compilespeed improvements: Exists arguments and others
It turns out that exists is not inlinable, even if put into List. We try to eliminate or hoist most closures passed to exists in Types. There are some other small improvements as well. -- (@gkossakowski): This commit contains also a fix to crasher prepared by @paulp. I squashed that commit and kept the test-case that came with it.
Diffstat (limited to 'test')
-rw-r--r--test/files/pos/specializes-sym-crash.scala26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/files/pos/specializes-sym-crash.scala b/test/files/pos/specializes-sym-crash.scala
new file mode 100644
index 0000000000..c46f435ac4
--- /dev/null
+++ b/test/files/pos/specializes-sym-crash.scala
@@ -0,0 +1,26 @@
+import scala.collection._
+
+trait Foo[+A,
+ +Coll,
+ +This <: GenSeqView[A, Coll] with GenSeqViewLike[A, Coll, This]]
+extends GenSeq[A] with GenSeqLike[A, This] with GenIterableView[A, Coll] with GenIterableViewLike[A, Coll, This] {
+self =>
+
+ trait Transformed[+B] extends GenSeqView[B, Coll] with super.Transformed[B] {
+ def length: Int
+ def apply(idx: Int): B
+ override def toString = viewToString
+ }
+ trait Reversed extends Transformed[A] {
+ override def iterator: Iterator[A] = createReversedIterator
+ def length: Int = self.length
+ def apply(idx: Int): A = self.apply(length - 1 - idx)
+ final override protected[this] def viewIdentifier = "R"
+
+ private def createReversedIterator = {
+ var lst = List[A]()
+ for (elem <- self) lst ::= elem
+ lst.iterator
+ }
+ }
+}