Commit 0a95a3d
committed
Fix parameter untupling
Make untupled parameters ValDefs instead of DefDefs so that their references are
stable paths. Add an additional check that untupled parameters don't come from
call-by-name parameters (in that case, ValDefs would be unsound).
I was trying hard to allow paramater untupling for cbn parameters, but this seems to be
very hard since parameter untupling happens as a desugaring step when the expected
parameter type is not yet known. And it seems really hard to change from stable to
unstable (or vice versa) later in the compilation pipleline without doing a lot of
re-checking.
Since untupled cbn parameters are a pretty extreme corner case anyway I think it's
OK to just disallow them.1 parent 20cc92e commit 0a95a3d
File tree
6 files changed
+80
-3
lines changed- compiler/src/dotty/tools/dotc
- ast
- transform
- tests
- neg
- pos
- run
6 files changed
+80
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
| |||
1426 | 1430 | | |
1427 | 1431 | | |
1428 | 1432 | | |
1429 | | - | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
1430 | 1436 | | |
1431 | 1437 | | |
1432 | 1438 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
258 | 266 | | |
259 | 267 | | |
260 | 268 | | |
| |||
356 | 364 | | |
357 | 365 | | |
358 | 366 | | |
| 367 | + | |
| 368 | + | |
359 | 369 | | |
360 | 370 | | |
361 | 371 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
0 commit comments