aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/t2503.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-06-07 18:26:43 +0200
committerMartin Odersky <odersky@gmail.com>2015-06-07 18:26:53 +0200
commit5733fdbd3ed3e8036992ee690bbd8270a36471a2 (patch)
treef5e86a799c19feed6a7d7c4efd7e9b23ee5ebaae /tests/pos/t2503.scala
parentcb2d81df7ef98e79874bf74227045a64ce86e75f (diff)
downloaddotty-5733fdbd3ed3e8036992ee690bbd8270a36471a2.tar.gz
dotty-5733fdbd3ed3e8036992ee690bbd8270a36471a2.tar.bz2
dotty-5733fdbd3ed3e8036992ee690bbd8270a36471a2.zip
Fix mergeDenot one more time.
It's easy to get this wrong. What happened was that when computing deferred members of a class a deferred member was preferred over a concrete one because the types did not match. Thsi should not happen. We now change the scheme to always prefer concrete over abstract, and subclass-owned over superclass-owned. But we pick a denotation only if the overrides relationship on types coincides with the preference on symbols.
Diffstat (limited to 'tests/pos/t2503.scala')
-rwxr-xr-xtests/pos/t2503.scala19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/pos/t2503.scala b/tests/pos/t2503.scala
new file mode 100755
index 000000000..d0983f2ca
--- /dev/null
+++ b/tests/pos/t2503.scala
@@ -0,0 +1,19 @@
+import scala.collection.mutable._
+
+trait SB[A] extends Buffer[A] {
+
+ import collection.Traversable
+
+ abstract override def insertAll(n: Int, iter: Traversable[A]): Unit = synchronized {
+ super.insertAll(n, iter)
+ }
+
+ abstract override def update(n: Int, newelem: A): Unit = synchronized {
+ super.update(n, newelem)
+ }
+}
+
+object Test extends dotty.runtime.LegacyApp {
+ new ArrayBuffer[Int] with SB[Int]
+}
+