Commit ded535d
committed
Reject trailing
The reason to do this only under -strict mode for now is so that
we can still compile the same code under both Scala 2 and Dotty.
If we rejected trailing `_` outright, Scala 2 code would need to
get either explicitly eta-expanded or get an expected type to still work.
But in Dotty, we can simply drop `_` for functions with arity >= 1.
So to keep code dual compilable, we'd need to add boilerplate
which under Dotty would be no longer needed._ syntax under -strict mode.1 parent 1f37b0c commit ded535d
File tree
3 files changed
+32
-4
lines changed- compiler
- src/dotty/tools/dotc/typer
- test/dotc
- tests/neg/customArgs
3 files changed
+32
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1538 | 1538 | | |
1539 | 1539 | | |
1540 | 1540 | | |
1541 | | - | |
| 1541 | + | |
1542 | 1542 | | |
1543 | 1543 | | |
1544 | | - | |
1545 | 1544 | | |
1546 | 1545 | | |
1547 | 1546 | | |
1548 | 1547 | | |
1549 | | - | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
1550 | 1566 | | |
1551 | 1567 | | |
1552 | 1568 | | |
| |||
2053 | 2069 | | |
2054 | 2070 | | |
2055 | 2071 | | |
2056 | | - | |
| 2072 | + | |
2057 | 2073 | | |
2058 | 2074 | | |
2059 | 2075 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments