diff options
author | Paul Phillips <paulp@improving.org> | 2009-02-10 18:45:55 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-02-10 18:45:55 +0000 |
commit | f4720669d6b4946653b5b419d85f5ec5a1e95bad (patch) | |
tree | db26965e258472e2ff56aa216b8fcc36d37a9ab6 /src | |
parent | 8d017c0f1e3478f2736a8df624492b73190b0976 (diff) | |
download | scala-f4720669d6b4946653b5b419d85f5ec5a1e95bad.tar.gz scala-f4720669d6b4946653b5b419d85f5ec5a1e95bad.tar.bz2 scala-f4720669d6b4946653b5b419d85f5ec5a1e95bad.zip |
Fixes and test cases for #944 and #1523.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Infer.scala | 3 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala index 7009adb35d..81bbfd1396 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala @@ -59,7 +59,8 @@ trait Infer { else actuals def actualArgs(pos: Position, actuals: List[Tree], nformals: Int): List[Tree] = - if (nformals == 1 && actuals.length != 1 && !phase.erasedTypes) List(atPos(pos)(gen.mkTuple(actuals))) else actuals + if (nformals == 1 && actuals.length != 1 && actuals.length <= definitions.MaxTupleArity && !phase.erasedTypes) + List(atPos(pos)(gen.mkTuple(actuals))) else actuals /** A fresh type varable with given type parameter as origin. * diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index ecce748314..20e5a9101e 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -1516,6 +1516,9 @@ trait Typers { self: Analyzer => def typedFunction(fun: Function, mode: Int, pt: Type): Tree = { val codeExpected = !forCLDC && !forMSIL && (pt.typeSymbol isNonBottomSubClass CodeClass) + if (fun.vparams.length > definitions.MaxFunctionArity) + return errorTree(fun, "implementation restricts functions to " + definitions.MaxFunctionArity + " parameters") + def decompose(pt: Type): (Symbol, List[Type], Type) = if ((isFunctionType(pt) || |