Commit c205a89
authored
ClassfileParser: allow missing param names (for JDK 21) (#17536)
this is a forward port of scala/scala#10397 (fixing scala/bug#12783,
from which Scala 3 also suffers) — the same fix we'll be shipping in
2.12.18 and 2.13.11
I haven't included a unit test, because
* a similar change has already been well validated in a Scala 2 context
* without this change, the compiler can't compile anything at all on JDK
21
* we need the reference compiler to include this change before we can
bootstrap on JDK 21 anyway
but I did manually test it locally, by bootstrapping on JDK 11,
publishing the resulting compiler locally, and then launching the REPL
and evaluating `2 + 2`
on 3.3.0-RC6, that fails with:
> error while loading AccessFlag,
> class file /modules/java.base/java/lang/reflect/AccessFlag.class is
broken, reading aborted with class java.lang.RuntimeException
> bad constant pool index: 0 at pos: 5189
> error while loading ElementType,
> class file /modules/java.base/java/lang/annotation/ElementType.class
is broken, reading aborted with class java.lang.RuntimeException
> bad constant pool index: 0 at pos: 1220
> 2 errors found
whereas with this change, it succeeds.File tree
1 file changed
+5
-3
lines changed- compiler/src/dotty/tools/dotc/core/classfile
1 file changed
+5
-3
lines changedLines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
758 | 758 | | |
759 | 759 | | |
760 | 760 | | |
761 | | - | |
| 761 | + | |
762 | 762 | | |
763 | | - | |
764 | | - | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
765 | 767 | | |
766 | 768 | | |
767 | 769 | | |
| |||
0 commit comments