Commit 4a959b1
committed
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.1 parent 40e076d commit 4a959b1
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 | |
|---|---|---|---|
| |||
2302 | 2302 | | |
2303 | 2303 | | |
2304 | 2304 | | |
2305 | | - | |
| 2305 | + | |
2306 | 2306 | | |
2307 | 2307 | | |
2308 | 2308 | | |
| |||
2736 | 2736 | | |
2737 | 2737 | | |
2738 | 2738 | | |
2739 | | - | |
2740 | | - | |
2741 | | - | |
2742 | | - | |
| 2739 | + | |
2743 | 2740 | | |
2744 | 2741 | | |
2745 | 2742 | | |
| |||
3070 | 3067 | | |
3071 | 3068 | | |
3072 | 3069 | | |
| 3070 | + | |
| 3071 | + | |
3073 | 3072 | | |
3074 | 3073 | | |
3075 | 3074 | | |
| |||
| 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