aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2015-08-17 16:31:57 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-08-17 16:31:57 +0200
commitaf3cee7d5dc19c24b92d6a93b917e3420ec2cf46 (patch)
tree72f8bce71d86caa57121abd09ff93aa367188a65 /tests
parent280e399a5ce984ad8b7892e510d6d3af3937a81e (diff)
downloaddotty-af3cee7d5dc19c24b92d6a93b917e3420ec2cf46.tar.gz
dotty-af3cee7d5dc19c24b92d6a93b917e3420ec2cf46.tar.bz2
dotty-af3cee7d5dc19c24b92d6a93b917e3420ec2cf46.zip
test #760
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))
+ }
+}