We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
=== What steps will reproduce the problem ===
scala> def f[A: Manifest](a: A) = java.util.Arrays.asList(Array(a): _*) f: [A](a: A)(implicit evidence$$1: Manifest[A])java.util.List[A] scala> f("") res0: java.util.List[java.lang.String] = [] scala> f(0) java.lang.ClassCastException: [I cannot be cast to [Ljava.lang.Object;
=== What is the expected behavior? ===
Box primitives into an Array[Object], as per #3304 / r21981.
scala> java.util.Arrays.asList(Array(0): _*) res17: java.util.List[Int] = r0 scala> res17.asInstanceOf[java.util.List[_ <: AnyRef]].get(0).getClass res18: java.lang.Class[_] = class java.lang.Integer
=== What do you see instead? ===
ClassCastException
=== Additional information === (for instance, a link to a relevant mailing list discussion)
No probs with Scala varargs:
scala> def g[A](a: A*) = () g: [A](a: A*)Unit scala> def h[A: Manifest](a: A) = g(Array(a): _*) h: [A](a: A)(implicit evidence$$1: Manifest[A])Unit scala> h("") scala> h(0)
=== What versions of the following are you using? ===
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-4216?orig=1 Reporter: @retronym Affected Versions: 2.9.2, 2.10.0
Sorry, something went wrong.
@adriaanm said: generalize SI-3304's fix to java varargs
@paulp said: I closed #750 as a duplicate of this: but it is not exactly a duplicate, so don't close this ticket without making sure that's fixed too.
@retronym said: scala/scala#478
@retronym said: scala/scala@a21f14d
adriaanm
No branches or pull requests
=== What steps will reproduce the problem ===
=== What is the expected behavior? ===
Box primitives into an Array[Object], as per #3304 / r21981.
=== What do you see instead? ===
ClassCastException
=== Additional information ===
(for instance, a link to a relevant mailing list discussion)
No probs with Scala varargs:
=== What versions of the following are you using? ===
The text was updated successfully, but these errors were encountered: