aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorodersky <odersky@gmail.com>2015-08-20 04:59:13 -0700
committerodersky <odersky@gmail.com>2015-08-20 04:59:13 -0700
commit1414fd5d595c43669c350ab1e8a14b38e0868b53 (patch)
treea18cc515dd0a9dd72290686b2d3882e39fe3317e /tests
parentab33d7aa90da65e8d1fb08452b74a8c9704a414e (diff)
parent21d08633a0ae611663d13faafb49aa37b372fdcc (diff)
downloaddotty-1414fd5d595c43669c350ab1e8a14b38e0868b53.tar.gz
dotty-1414fd5d595c43669c350ab1e8a14b38e0868b53.tar.bz2
dotty-1414fd5d595c43669c350ab1e8a14b38e0868b53.zip
Merge pull request #760 from dotty-staging/mixin-fixes
Fixes to scala2 Mixin
Diffstat (limited to 'tests')
-rw-r--r--tests/run/scala2mixins.scala23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/run/scala2mixins.scala b/tests/run/scala2mixins.scala
new file mode 100644
index 000000000..059e156f3
--- /dev/null
+++ b/tests/run/scala2mixins.scala
@@ -0,0 +1,23 @@
+import scala.collection.IndexedSeqOptimized
+import scala.collection.mutable.Builder
+
+object Test {
+ class Name extends Seq[Int]
+ with IndexedSeqOptimized[Int, Name] {
+ val underlying = 0 to 10
+ def length: Int = underlying.length
+
+ def apply(idx: Int): Int = underlying(idx)
+
+ override protected[this] def newBuilder: Builder[Int, Name] = ???
+
+ override def seq = toCollection(this)
+
+ }
+ def main(args: Array[String]): Unit = {
+ val n = new Name
+ // need to make sure that super accessors were emitted
+ // ends with calls super.endsWith if argument is not an IndexedSeq
+ assert(n.endsWith(10 :: Nil))
+ }
+}