diff options
author | Martin Odersky <odersky@gmail.com> | 2008-05-21 13:56:51 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2008-05-21 13:56:51 +0000 |
commit | 7eea3c922d48e830ebf157baee652d65da75ed89 (patch) | |
tree | 377f5dbb931a54dc2758e2d3910c0d5a0f6489c4 /src | |
parent | 0425a6b3f7f5122024e2adbb8f595ce662acc574 (diff) | |
download | scala-7eea3c922d48e830ebf157baee652d65da75ed89.tar.gz scala-7eea3c922d48e830ebf157baee652d65da75ed89.tar.bz2 scala-7eea3c922d48e830ebf157baee652d65da75ed89.zip |
Fixed #677
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Infer.scala | 2 | ||||
-rw-r--r-- | src/library/scala/runtime/BoxedAnyArray.scala | 44 |
2 files changed, 45 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala index 182a94b97b..e31571e8bf 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala @@ -59,7 +59,7 @@ trait Infer { else actuals def actualArgs(pos: Position, actuals: List[Tree], nformals: Int): List[Tree] = - if (nformals == 1 && actuals.length != 1) List(atPos(pos)(gen.mkTuple(actuals))) else actuals + if (nformals == 1 && actuals.length != 1 && !phase.erasedTypes) List(atPos(pos)(gen.mkTuple(actuals))) else actuals /** A fresh type varable with given type parameter as origin. * diff --git a/src/library/scala/runtime/BoxedAnyArray.scala b/src/library/scala/runtime/BoxedAnyArray.scala index 3e532cb5d5..0a251ab9c0 100644 --- a/src/library/scala/runtime/BoxedAnyArray.scala +++ b/src/library/scala/runtime/BoxedAnyArray.scala @@ -24,6 +24,50 @@ import compat.Platform @serializable final class BoxedAnyArray(val length: Int) extends BoxedArray { + def this(dim1: Int, dim2: Int) = { + this(dim1); + initializeWith(i => new BoxedAnyArray(dim2)) + } + + def this(dim1: Int, dim2: Int, dim3: Int) = { + this(dim1); + initializeWith(i => new BoxedAnyArray(dim2, dim3)) + } + + def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int) = { + this(dim1); + initializeWith(i => new BoxedAnyArray(dim2, dim3, dim4)) + } + + def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int) = { + this(dim1); + initializeWith(i => new BoxedAnyArray(dim2, dim3, dim4, dim5)) + } + + def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int) = { + this(dim1); + initializeWith(i => new BoxedAnyArray(dim2, dim3, dim4, dim5, dim6)) + } + + def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int, dim7: Int) = { + this(dim1); + initializeWith(i => new BoxedAnyArray(dim2, dim3, dim4, dim5, dim6, dim7)) + } + + def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int, dim7: Int, dim8: Int) = { + this(dim1); + initializeWith(i => new BoxedAnyArray(dim2, dim3, dim4, dim5, dim6, dim7, dim8)) + } + + def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int, dim7: Int, dim8: Int, dim9: Int) = { + this(dim1); + initializeWith(i => new BoxedAnyArray(dim2, dim3, dim4, dim5, dim6, dim7, dim8, dim9)) + } + + private def initializeWith(elem: Int => Any) = { + for (i <- 0 until length) update(i, elem(i)) + } + private var boxed = new Array[AnyRef](length) private val hash = boxed.hashCode() private var unboxed: AnyRef = null |