File tree 5 files changed +31
-2
lines changed
src/dotty/tools/dotc/core/classfile
test/dotty/tools/backend/jvm
5 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,10 @@ object ClassfileConstants {
73
73
74
74
inline val CONSTANT_METHODHANDLE = 15
75
75
inline val CONSTANT_METHODTYPE = 16
76
+ inline val CONSTANT_DYNAMIC = 17
76
77
inline val CONSTANT_INVOKEDYNAMIC = 18
78
+ inline val CONSTANT_MODULE = 19
79
+ inline val CONSTANT_PACKAGE = 20
77
80
78
81
// tags describing the type of a literal in attribute values
79
82
inline val BYTE_TAG = 'B'
Original file line number Diff line number Diff line change @@ -1224,13 +1224,14 @@ class ClassfileParser(
1224
1224
(in.nextByte.toInt: @ switch) match {
1225
1225
case CONSTANT_UTF8 | CONSTANT_UNICODE =>
1226
1226
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 =>
1228
1229
in.skip(2 )
1229
1230
case CONSTANT_METHODHANDLE =>
1230
1231
in.skip(3 )
1231
1232
case CONSTANT_FIELDREF | CONSTANT_METHODREF | CONSTANT_INTFMETHODREF
1232
1233
| CONSTANT_NAMEANDTYPE | CONSTANT_INTEGER | CONSTANT_FLOAT
1233
- | CONSTANT_INVOKEDYNAMIC =>
1234
+ | CONSTANT_INVOKEDYNAMIC | CONSTANT_DYNAMIC =>
1234
1235
in.skip(4 )
1235
1236
case CONSTANT_LONG | CONSTANT_DOUBLE =>
1236
1237
in.skip(8 )
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ class ClassfileParserTest {
36
36
// in ClassfileConstants! that would defeat the purpose of the test
37
37
" CONSTANT_CLASS" ,
38
38
" CONSTANT_DOUBLE" ,
39
+ " CONSTANT_DYNAMIC" ,
39
40
" CONSTANT_FIELDREF" ,
40
41
" CONSTANT_FLOAT" ,
41
42
" CONSTANT_INTEGER" ,
@@ -45,7 +46,9 @@ class ClassfileParserTest {
45
46
" CONSTANT_METHODHANDLE" ,
46
47
" CONSTANT_METHODREF" ,
47
48
" CONSTANT_METHODTYPE" ,
49
+ " CONSTANT_MODULE" ,
48
50
" CONSTANT_NAMEANDTYPE" ,
51
+ " CONSTANT_PACKAGE" ,
49
52
" CONSTANT_STRING" ,
50
53
" CONSTANT_UNICODE" ,
51
54
" 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