File tree Expand file tree Collapse file tree 5 files changed +31
-2
lines changed
src/dotty/tools/dotc/core/classfile
test/dotty/tools/backend/jvm Expand file tree Collapse file tree 5 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,10 @@ object ClassfileConstants {
7373
7474 inline val CONSTANT_METHODHANDLE = 15
7575 inline val CONSTANT_METHODTYPE = 16
76+ inline val CONSTANT_DYNAMIC = 17
7677 inline val CONSTANT_INVOKEDYNAMIC = 18
78+ inline val CONSTANT_MODULE = 19
79+ inline val CONSTANT_PACKAGE = 20
7780
7881 // tags describing the type of a literal in attribute values
7982 inline val BYTE_TAG = 'B'
Original file line number Diff line number Diff line change @@ -1224,13 +1224,14 @@ class ClassfileParser(
12241224 (in.nextByte.toInt: @ switch) match {
12251225 case CONSTANT_UTF8 | CONSTANT_UNICODE =>
12261226 in.skip(in.nextChar)
1227- case CONSTANT_CLASS | CONSTANT_STRING | CONSTANT_METHODTYPE =>
1227+ case CONSTANT_CLASS | CONSTANT_STRING | CONSTANT_METHODTYPE
1228+ | CONSTANT_MODULE | CONSTANT_PACKAGE =>
12281229 in.skip(2 )
12291230 case CONSTANT_METHODHANDLE =>
12301231 in.skip(3 )
12311232 case CONSTANT_FIELDREF | CONSTANT_METHODREF | CONSTANT_INTFMETHODREF
12321233 | CONSTANT_NAMEANDTYPE | CONSTANT_INTEGER | CONSTANT_FLOAT
1233- | CONSTANT_INVOKEDYNAMIC =>
1234+ | CONSTANT_INVOKEDYNAMIC | CONSTANT_DYNAMIC =>
12341235 in.skip(4 )
12351236 case CONSTANT_LONG | CONSTANT_DOUBLE =>
12361237 in.skip(8 )
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ class ClassfileParserTest {
3636 // in ClassfileConstants! that would defeat the purpose of the test
3737 " CONSTANT_CLASS" ,
3838 " CONSTANT_DOUBLE" ,
39+ " CONSTANT_DYNAMIC" ,
3940 " CONSTANT_FIELDREF" ,
4041 " CONSTANT_FLOAT" ,
4142 " CONSTANT_INTEGER" ,
@@ -45,7 +46,9 @@ class ClassfileParserTest {
4546 " CONSTANT_METHODHANDLE" ,
4647 " CONSTANT_METHODREF" ,
4748 " CONSTANT_METHODTYPE" ,
49+ " CONSTANT_MODULE" ,
4850 " CONSTANT_NAMEANDTYPE" ,
51+ " CONSTANT_PACKAGE" ,
4952 " CONSTANT_STRING" ,
5053 " CONSTANT_UNICODE" ,
5154 " CONSTANT_UTF8" ,
Original file line number Diff line number Diff line change 1+ // test: -jvm 21+
2+
3+ public class A_1 {
4+ public int f (Object s ) {
5+ switch (s ) {
6+ case Res .R -> {
7+ return 1 ;
8+ }
9+ default -> {
10+ return 3 ;
11+ }
12+ }
13+ }
14+ static enum Res {
15+ R
16+ }
17+ }
Original file line number Diff line number Diff line change 1+ // test: -jvm 21+
2+
3+ class B {
4+ def bar = (new A_1 ).f(null )
5+ }
You can’t perform that action at this time.
0 commit comments