summaryrefslogtreecommitdiff
path: root/test/pending/run/t4996.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-02-18 22:55:34 -0800
committerPaul Phillips <paulp@improving.org>2012-02-18 23:48:26 -0800
commitec160bae7e2935d98bf71cfb6dcba61f1979b854 (patch)
tree11ed857d21aaac691481e12eabfc53a4446065d4 /test/pending/run/t4996.scala
parent0d19fe04eb43d39bdceab570fb5400a3a4b072ea (diff)
downloadscala-ec160bae7e2935d98bf71cfb6dcba61f1979b854.tar.gz
scala-ec160bae7e2935d98bf71cfb6dcba61f1979b854.tar.bz2
scala-ec160bae7e2935d98bf71cfb6dcba61f1979b854.zip
More on SI-5500.
A reimagining of erik's patch in 1df4fc6e59 . He did the hard part, this is the batman reboot. I added more tests and tried to make the anyref caching code less fragile.
Diffstat (limited to 'test/pending/run/t4996.scala')
-rw-r--r--test/pending/run/t4996.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/pending/run/t4996.scala b/test/pending/run/t4996.scala
new file mode 100644
index 0000000000..58a8fe16a3
--- /dev/null
+++ b/test/pending/run/t4996.scala
@@ -0,0 +1,15 @@
+object SpecializationAbstractOverride {
+
+ trait A[@specialized(Int) T] { def foo(t: T) }
+ trait B extends A[Int] { def foo(t: Int) { println("B.foo") } }
+ trait M extends B { abstract override def foo(t: Int) { super.foo(t) ; println ("M.foo") } }
+ object C extends B with M
+
+ object D extends B { override def foo(t: Int) { super.foo(t); println("M.foo") } }
+
+ def main(args: Array[String]) {
+ D.foo(42) // OK, prints B.foo M.foo
+ C.foo(42) // StackOverflowError
+ }
+}
+