summaryrefslogtreecommitdiff
path: root/test/files/run/t5488.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-02-17 09:52:40 -0800
committerPaul Phillips <paulp@improving.org>2012-02-17 11:10:23 -0800
commit1e648c386216d4c60121321a7ec40e2536bada9c (patch)
tree300e7095cf45ba476dd5717f028cd154f4e7f702 /test/files/run/t5488.scala
parent91148376049a152edec12348ff9b7e9e93e6ebe1 (diff)
downloadscala-1e648c386216d4c60121321a7ec40e2536bada9c.tar.gz
scala-1e648c386216d4c60121321a7ec40e2536bada9c.tar.bz2
scala-1e648c386216d4c60121321a7ec40e2536bada9c.zip
Fixed AnyRef specialization.
At least for the value of fix which means "better than it was in 2.9." I accidentally spent a long while trying to fix something I didn't realize I hadn't broken. But then I lucked into partially fixing it, so that's good news. See run/t5488-fn.scala if you want to see what still doesn't work. (It's covered at SI-4770, which is now reopened.) Closes SI-5488.
Diffstat (limited to 'test/files/run/t5488.scala')
-rw-r--r--test/files/run/t5488.scala26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/files/run/t5488.scala b/test/files/run/t5488.scala
new file mode 100644
index 0000000000..7bab0cdc3c
--- /dev/null
+++ b/test/files/run/t5488.scala
@@ -0,0 +1,26 @@
+class A0[@specialized(Int, AnyRef) A]()
+class B0[@specialized(Int, AnyRef) A, @specialized(Int, AnyRef) B]()
+class C0[@specialized(Int, AnyRef) A, @specialized(Int, AnyRef) B, @specialized(Int, AnyRef) C]()
+
+object Test {
+ def main(args:Array[String]) {
+ def show(x: Any) = println(x.getClass.getName)
+
+ show(new A0[Int]())
+ show(new A0[AnyRef]())
+
+ show(new B0[Int, Int]())
+ show(new B0[Int, AnyRef]())
+ show(new B0[AnyRef, Int]())
+ show(new B0[AnyRef, AnyRef]())
+
+ show(new C0[Int, Int, Int]())
+ show(new C0[Int, Int, AnyRef]())
+ show(new C0[Int, AnyRef, Int]())
+ show(new C0[Int, AnyRef, AnyRef]())
+ show(new C0[AnyRef, Int, Int]())
+ show(new C0[AnyRef, Int, AnyRef]())
+ show(new C0[AnyRef, AnyRef, Int]())
+ show(new C0[AnyRef, AnyRef, AnyRef]())
+ }
+}