Commit 7029ee1
committed
Tighten Ycheck of type ascriptions
We previously did not check that Typed nodes are type-correct,
i.e. that the type of the expression conforms to the given type.
Now we do. This uncovered problems in three different places:
- for internal gadt ascriptions, where a cast should be used instead of
a type ascription.
- for avoidance, where two tests fail
- for PCPCheckAndHeal, where at least one test fails
For now, the logic in avoidance is changed so that we use a cast if an ascription
is incorrect. But this should be fixed so that the cast is never needed, if possible.
After the inlining phase, we fall back to the old logic for typedTyped that
does not check conformance. This is because of PCPCheckAndHeal. This problem should also be
followed up.
We also had to disable one FromTasty test to pass the stricter requirements1 parent d26549d commit 7029ee1
File tree
3 files changed
+42
-8
lines changed- compiler
- src/dotty/tools/dotc
- transform
- typer
- test/dotc
3 files changed
+42
-8
lines changedLines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
425 | 449 | | |
426 | 450 | | |
427 | 451 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
814 | 814 | | |
815 | 815 | | |
816 | 816 | | |
817 | | - | |
818 | 817 | | |
819 | | - | |
820 | | - | |
821 | | - | |
| 818 | + | |
| 819 | + | |
822 | 820 | | |
823 | 821 | | |
824 | 822 | | |
| |||
844 | 842 | | |
845 | 843 | | |
846 | 844 | | |
847 | | - | |
848 | | - | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
849 | 849 | | |
850 | 850 | | |
851 | 851 | | |
| |||
1055 | 1055 | | |
1056 | 1056 | | |
1057 | 1057 | | |
1058 | | - | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
1059 | 1066 | | |
1060 | 1067 | | |
1061 | 1068 | | |
| |||
3693 | 3700 | | |
3694 | 3701 | | |
3695 | 3702 | | |
3696 | | - | |
| 3703 | + | |
3697 | 3704 | | |
3698 | 3705 | | |
3699 | 3706 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
0 commit comments