diff options
author | odersky <odersky@gmail.com> | 2015-08-20 04:59:13 -0700 |
---|---|---|
committer | odersky <odersky@gmail.com> | 2015-08-20 04:59:13 -0700 |
commit | 1414fd5d595c43669c350ab1e8a14b38e0868b53 (patch) | |
tree | a18cc515dd0a9dd72290686b2d3882e39fe3317e /tests | |
parent | ab33d7aa90da65e8d1fb08452b74a8c9704a414e (diff) | |
parent | 21d08633a0ae611663d13faafb49aa37b372fdcc (diff) | |
download | dotty-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.scala | 23 |
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)) + } +} |