Commit c80d6e4
committed
Fix ClassCastException with Java primitive varargs
The class constant corresponding to the primitive type `int` is
represented in bytecode by `Integer.TYPE`, this is correctly handled
when calling `clsOf`, but so far `ElimRepeated` was manually creating a
constant instead which does not work (I've now changed the backend to
emit a failure instead of doing the wrong thing when someone does that,
I also plan to rework the way we handle classOf to make this less
error-prone).
Note: after this commit, tests/run/t1360.scala started failing, this is
fixed in the next commit.1 parent c7fb0fc commit c80d6e4
File tree
4 files changed
+15
-8
lines changed- compiler/src/dotty/tools
- backend/jvm
- dotc/transform
- tests/run/java-varargs
4 files changed
+15
-8
lines changedLines changed: 4 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
493 | 490 | | |
494 | 491 | | |
495 | 492 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments