Skip to content

Commit 318e887

Browse files
committed
Add Function25 on top of #1413.
1 parent 79e0fe0 commit 318e887

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import scala.reflect.api.{ Universe => ApiUniverse }
1313

1414
object Definitions {
1515
val MaxTupleArity, MaxAbstractFunctionArity = 22
16-
val MaxFunctionArity = 24
17-
// Awaiting a definite solution that drops the limit altogether, 24 gives a safety
16+
val MaxFunctionArity = 25
17+
// Awaiting a definite solution that drops the limit altogether, 25 gives a safety
1818
// margin over the previous 22, so that treecopiers in miniphases are allowed to
1919
// temporarily create larger closures. This is needed in lambda lift where large closures
2020
// are first formed by treecopiers before they are split apart into parameters and

src/scala/Function25.scala

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* __ *\
2+
** ________ ___ / / ___ Scala API **
3+
** / __/ __// _ | / / / _ | (c) 2002-2013, LAMP/EPFL **
4+
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
5+
** /____/\___/_/ |_/____/_/ | | **
6+
** |/ **
7+
\* */
8+
package scala
9+
10+
11+
/** A function of 25 parameters. Used as a temporary fix until arity limit is dropped.
12+
*
13+
*/
14+
trait Function25[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, -T10, -T11, -T12, -T13, -T14, -T15, -T16, -T17, -T18, -T19, -T20, -T21, -T22, -T23, -T24, -T25, +R] extends AnyRef { self =>
15+
/** Apply the body of this function to the arguments.
16+
* @return the result of function application.
17+
*/
18+
def apply(v1: T1, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6, v7: T7, v8: T8, v9: T9, v10: T10, v11: T11, v12: T12, v13: T13, v14: T14, v15: T15, v16: T16, v17: T17, v18: T18, v19: T19, v20: T20, v21: T21, v22: T22, v23: T23, v24: T24, v25: T25): R
19+
20+
override def toString() = "<function25>"
21+
}

0 commit comments

Comments
 (0)