summaryrefslogtreecommitdiff
path: root/test/files/run/t4216.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-05-05 17:52:33 +0200
committerJason Zaugg <jzaugg@gmail.com>2012-05-05 17:53:46 +0200
commita21f14defaedd6ba314261bf78a0d257823c080b (patch)
treefd8c85a3996c23664f906986fa68487d16198d03 /test/files/run/t4216.scala
parentdd8f53d510ad820d5b34b20f2846c8da5d4942a1 (diff)
downloadscala-a21f14defaedd6ba314261bf78a0d257823c080b.tar.gz
scala-a21f14defaedd6ba314261bf78a0d257823c080b.tar.bz2
scala-a21f14defaedd6ba314261bf78a0d257823c080b.zip
Don't admit primitive arrays as a generic Java varargs param.
They were sneaking through as polymorphic Arrays and avoiding boxing. Closes SI-4216
Diffstat (limited to 'test/files/run/t4216.scala')
-rw-r--r--test/files/run/t4216.scala18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/files/run/t4216.scala b/test/files/run/t4216.scala
new file mode 100644
index 0000000000..4ada8f48aa
--- /dev/null
+++ b/test/files/run/t4216.scala
@@ -0,0 +1,18 @@
+import scala.tools.partest.ReplTest
+
+// t4216
+object Test extends ReplTest {
+ def code =
+ """
+ |def f[A: ArrayTag](a: A) = java.util.Arrays.asList(Array(a): _*)
+ |f(".")
+ |f(0)
+ |def i(a: Int) = java.util.Arrays.asList(Array(a): _*)
+ |i(0)
+ |def o(a: Any) = java.util.Arrays.asList(Array(a): _*)
+ |o(".")
+ |class V(val a: Int) extends AnyVal
+ |f(new V(0))
+ |o(new V(0))
+ |""".stripMargin.trim
+}