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 /src/compiler/scala/tools/nsc/transform/UnCurry.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 'src/compiler/scala/tools/nsc/transform/UnCurry.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/UnCurry.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala index 394957c747..cf00ee6b5d 100644 --- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala +++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala @@ -449,7 +449,8 @@ abstract class UnCurry extends InfoTransform } afterUncurry { - if (isJava && isPrimitiveArray(suffix.tpe) && isArrayOfSymbol(fun.tpe.params.last.tpe, ObjectClass)) { + if (isJava && !isReferenceArray(suffix.tpe) && isArrayOfSymbol(fun.tpe.params.last.tpe, ObjectClass)) { + // The array isn't statically known to be a reference array, so call ScalaRuntime.toObjectArray. suffix = localTyper.typedPos(pos) { gen.mkRuntimeCall(nme.toObjectArray, List(suffix)) } |