summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-10-05 08:05:08 -0700
committerPaul Phillips <paulp@improving.org>2012-10-05 09:12:06 -0700
commit781788c9e23b7c5e1406e2fbc9dc2aaa8764381a (patch)
treef8f8e180a9e068bc051e4722d44b732d33d22047 /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parentd42b1e9e0c08349ae97212296aca4c2bad2cc7f2 (diff)
downloadscala-781788c9e23b7c5e1406e2fbc9dc2aaa8764381a.tar.gz
scala-781788c9e23b7c5e1406e2fbc9dc2aaa8764381a.tar.bz2
scala-781788c9e23b7c5e1406e2fbc9dc2aaa8764381a.zip
Incorporated pull request feedback.
And fixed the test I broke at the last minute. Reworked tupling logic to make it harder to break. Expanded test coverage.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 3054993c20..87f165a54c 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -2973,14 +2973,15 @@ trait Typers extends Modes with Adaptations with Tags {
case mt @ MethodType(params, _) =>
val paramTypes = mt.paramTypes
// repeat vararg as often as needed, remove by-name
- val formals = formalTypes(paramTypes, args.length)
+ val argslen = args.length
+ val formals = formalTypes(paramTypes, argslen)
/** Try packing all arguments into a Tuple and apply `fun`
* to that. This is the last thing which is tried (after
* default arguments)
*/
def tryTupleApply: Option[Tree] = {
- if (eligibleForTupleConversion(formals, args) && !phase.erasedTypes) {
+ if (eligibleForTupleConversion(paramTypes, argslen) && !phase.erasedTypes) {
val tupleArgs = List(atPos(tree.pos.makeTransparent)(gen.mkTuple(args)))
// expected one argument, but got 0 or >1 ==> try applying to tuple
// the inner "doTypedApply" does "extractUndetparams" => restore when it fails