summaryrefslogtreecommitdiff
path: root/test/files/run/t5500b.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/files/run/t5500b.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/files/run/t5500b.scala')
-rw-r--r--test/files/run/t5500b.scala51
1 files changed, 51 insertions, 0 deletions
diff --git a/test/files/run/t5500b.scala b/test/files/run/t5500b.scala
new file mode 100644
index 0000000000..32de858e7b
--- /dev/null
+++ b/test/files/run/t5500b.scala
@@ -0,0 +1,51 @@
+import scala.{specialized => spec}
+
+class C1A[
+ @spec(Double, Int, AnyRef) A,
+ @spec(Double, Int, AnyRef) B
+]
+
+class C1B[
+ @spec(Double, Int, AnyRef) A,
+ @spec(Double, Int, AnyRef) B
+](v: A)
+
+class C1C[
+ @spec(Double, Int, AnyRef) A,
+ @spec(Double, Int, AnyRef) B
+](v:A, w:B)
+
+object Test {
+ def main(args:Array[String]) {
+ println(new C1A[String, Int].getClass.getName)
+ println(new C1A[String, Double].getClass.getName)
+ println(new C1A[String, String].getClass.getName)
+ println(new C1A[Int, Int].getClass.getName)
+ println(new C1A[Int, Double].getClass.getName)
+ println(new C1A[Int, String].getClass.getName)
+ println(new C1A[Double, Int].getClass.getName)
+ println(new C1A[Double, Double].getClass.getName)
+ println(new C1A[Double, String].getClass.getName)
+
+ println(new C1B[String, Int]("abc").getClass.getName)
+ println(new C1B[String, Double]("abc").getClass.getName)
+ println(new C1B[String, String]("abc").getClass.getName)
+ println(new C1B[Int, Int](1).getClass.getName)
+ println(new C1B[Int, Double](1).getClass.getName)
+ println(new C1B[Int, String](1).getClass.getName)
+ println(new C1B[Double, Int](1d).getClass.getName)
+ println(new C1B[Double, Double](1d).getClass.getName)
+ println(new C1B[Double, String](1d).getClass.getName)
+
+ println(new C1C("abc", 123).getClass.getName)
+ println(new C1C("abc", 123).getClass.getName)
+ println(new C1C("a", 1d).getClass.getName)
+ println(new C1C("a", "a").getClass.getName)
+ println(new C1C(1, 1).getClass.getName)
+ println(new C1C(1, 1d).getClass.getName)
+ println(new C1C(1, "a").getClass.getName)
+ println(new C1C(1d, 1).getClass.getName)
+ println(new C1C(1d, 1d).getClass.getName)
+ println(new C1C(1d, "a").getClass.getName)
+ }
+}