Commit a57a959
More systematic handling of invalid prefixes
It looks like there are many situations where an illegal higher-kinded type in an argument for
a value type parameter causes illegal TermRefs and TypeRefs to be constructed, leading to an
assertion error. We now turn the assertion error into a specialized exception which eventually
leads to a TypeError being thrown.
The problem is we cannot detect illegal kinds in arguments early enough to prevent these
situations. We do detect them later, but the damage can already be done before that.
[Cherry-picked 4a959b1]1 parent 4564fbe commit a57a959
File tree
3 files changed
+19
-8
lines changed- compiler/src/dotty/tools/dotc/core
- tests/neg
3 files changed
+19
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2261 | 2261 | | |
2262 | 2262 | | |
2263 | 2263 | | |
2264 | | - | |
| 2264 | + | |
2265 | 2265 | | |
2266 | 2266 | | |
2267 | 2267 | | |
| |||
2682 | 2682 | | |
2683 | 2683 | | |
2684 | 2684 | | |
2685 | | - | |
2686 | | - | |
2687 | | - | |
2688 | | - | |
| 2685 | + | |
2689 | 2686 | | |
2690 | 2687 | | |
2691 | 2688 | | |
| |||
3041 | 3038 | | |
3042 | 3039 | | |
3043 | 3040 | | |
| 3041 | + | |
| 3042 | + | |
3044 | 3043 | | |
3045 | 3044 | | |
3046 | 3045 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | | - | |
45 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
| |||
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
64 | 75 | | |
65 | 76 | | |
66 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
0 commit comments