diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2012-05-05 17:52:33 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2012-05-05 17:53:46 +0200 |
commit | a21f14defaedd6ba314261bf78a0d257823c080b (patch) | |
tree | fd8c85a3996c23664f906986fa68487d16198d03 /test/files/run/t4216.scala | |
parent | dd8f53d510ad820d5b34b20f2846c8da5d4942a1 (diff) | |
download | scala-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.scala | 18 |
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 +} |