Skip to content

Commit 62d4cc9

Browse files
committed
Fix scala#10133: don't parse RuntimeInvisibleAnnotationATTR
Now we do the same as Scala 2. It reverts the following commit: scala@6be9c7c
1 parent 1ab76c1 commit 62d4cc9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -699,14 +699,13 @@ class ClassfileParser(
699699
sym.addAnnotation(Annotation(defn.AnnotationDefaultAnnot, Nil))
700700

701701
// Java annotations on classes / methods / fields with RetentionPolicy.RUNTIME
702-
case tpnme.RuntimeVisibleAnnotationATTR
703-
| tpnme.RuntimeInvisibleAnnotationATTR =>
702+
case tpnme.RuntimeVisibleAnnotationATTR =>
704703
parseAnnotations(attrLen)
705704

706705
// TODO 1: parse runtime visible annotations on parameters
707706
// case tpnme.RuntimeParamAnnotationATTR
708707

709-
// TODO 2: also parse RuntimeInvisibleParamAnnotation
708+
// TODO 2: also parse RuntimeInvisibleAnnotationATTR / RuntimeInvisibleParamAnnotation
710709
// i.e. java annotations with RetentionPolicy.CLASS?
711710

712711
case tpnme.ExceptionsATTR =>
@@ -938,7 +937,7 @@ class ClassfileParser(
938937
// attribute isn't, this classfile is a compilation artifact.
939938
return Some(NoEmbedded)
940939

941-
if (scan(tpnme.RuntimeVisibleAnnotationATTR) || scan(tpnme.RuntimeInvisibleAnnotationATTR)) {
940+
if (scan(tpnme.RuntimeVisibleAnnotationATTR)) {
942941
val attrLen = in.nextInt
943942
val nAnnots = in.nextChar
944943
var i = 0

0 commit comments

Comments
 (0)