Commit 595c5d7
authored
Add a check for correct Array shape in quotes.reflect.ClassOfConstant (#22033)
Closes #21916
I tried to supply the ClassOfConstant with multiple other broken Types,
but I was unable to break it beyond the linked issue, so I ended up
adding the check for only that one case. This makes sense - the backend
(and thus erasure) needs to know if the Array type parameter is a
primitive type, but in other cases the erasure phase needs to know only
the class, without the type parameters.
It's impossible to call classOf through the quoted code (`'{classOf[t]}`
with a boundless t will error out), so we don't need that additional
check there.
There does appear to be an issue with being able to set `'{List[Array]}`
resulting in a crash, but that is beyond the scope of this fix - I will
prepare a separate issue for that (edit: reported
[here](#22034)).File tree
4 files changed
+38
-1
lines changed- compiler/src/scala/quoted/runtime/impl
- tests/neg-macros
- i21916
4 files changed
+38
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2530 | 2530 | | |
2531 | 2531 | | |
2532 | 2532 | | |
2533 | | - | |
| 2533 | + | |
| 2534 | + | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
| 2538 | + | |
| 2539 | + | |
| 2540 | + | |
| 2541 | + | |
| 2542 | + | |
| 2543 | + | |
2534 | 2544 | | |
2535 | 2545 | | |
2536 | 2546 | | |
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments