forked from scala/scala3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix scala#1543: Add synthetic FunctionN types.
With this change it is possible to have create types for funtions of any arity. This ensures that the compiler will not crash when creating FunProto when typing a method application method applications with more than MaxFunctionArity parameters. Note that in the language the functions are still bound to MaxFunctionArity, but this is a first small step towards supporting any function arity.
- Loading branch information
1 parent
93d4c8c
commit abfa986
Showing
6 changed files
with
126 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
object Foo { | ||
new Function0 | ||
new Function22 | ||
new Function30 | ||
new Function31 // error: not found: type Function31 | ||
new Function100000 // error: not found: type Function100000 | ||
new `Function-1` // error : not found: type Function-1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
1 | ||
2 | ||
3 | ||
4 | ||
5 | ||
6 | ||
7 | ||
8 | ||
9 | ||
10 | ||
11 | ||
12 | ||
13 | ||
14 | ||
15 | ||
16 | ||
17 | ||
18 | ||
19 | ||
20 | ||
21 | ||
22 | ||
23 | ||
24 | ||
25 | ||
26 | ||
27 | ||
28 | ||
29 | ||
30 | ||
31 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
object Test extends dotty.runtime.LegacyApp { | ||
new Bar().foo(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31) | ||
} | ||
|
||
|
||
class Bar { | ||
def foo(p1: Int, p2: Int, p3: Int, p4: Int, p5: Int, p6: Int, p7: Int, p8: Int, p9: Int, p10: Int, p11: Int, p12: Int, p13: Int, p14: Int, p15: Int, p16: Int, p17: Int, p18: Int, p19: Int, p20: Int, p21: Int, p22: Int, p23: Int, p24: Int, p25: Int, p26: Int, p27: Int, p28: Int, p29: Int, p30: Int, p31: Int): Unit = { | ||
println(p1) | ||
println(p2) | ||
println(p3) | ||
println(p4) | ||
println(p5) | ||
println(p6) | ||
println(p7) | ||
println(p8) | ||
println(p9) | ||
println(p10) | ||
println(p11) | ||
println(p12) | ||
println(p13) | ||
println(p14) | ||
println(p15) | ||
println(p16) | ||
println(p17) | ||
println(p18) | ||
println(p19) | ||
println(p20) | ||
println(p21) | ||
println(p22) | ||
println(p23) | ||
println(p24) | ||
println(p25) | ||
println(p26) | ||
println(p27) | ||
println(p28) | ||
println(p29) | ||
println(p30) | ||
println(p31) | ||
} | ||
} |