File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ The limits of 22 for the maximal number of parameters of function types
7
7
and the maximal number of fields in tuple types have been dropped.
8
8
9
9
Functions can now have an arbitrary number of
10
- parameters. Functions beyond Function22 are represented with a new trait
11
- ` scala.FunctionXXL ` .
10
+ parameters. Functions beyond Function22 are erased to a new trait
11
+ ` scala.FunctionXXL ` and tuples beyond Tuple22 are erased to a new trait ` scala.TupleXXL ` .
12
+ Both of these are implemented using arrays.
12
13
13
14
Tuples can also have an arbitrary number of fields. Furthermore, they support generic operation such as concatenation and indexing.
Original file line number Diff line number Diff line change @@ -22,6 +22,12 @@ trait TupledFunction[F, G] {
22
22
}
23
23
```
24
24
25
+ The compiler will synthesize an instance of ` TupledFunction[F, G] ` if:
26
+
27
+ * ` F ` is a function type of arity ` N `
28
+ * ` G ` is a function with a single tuple argument of size ` N ` and it's types are equal to the arguments of ` F `
29
+ * The return type of ` F ` is equal to the return type of ` G `
30
+ * ` F ` and ` G ` are the same kind of functions (` given ` arguments or not)
25
31
26
32
Examples
27
33
--------
You can’t perform that action at this time.
0 commit comments