Skip to content

Commit 653abda

Browse files
Backport "Fail early & more clearly on shaded-broken classfiles" to LTS (#22083)
Backports #21262 to the 3.3.5. PR submitted by the release tooling. [skip ci]
2 parents 33ad399 + 9d9664f commit 653abda

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,10 @@ class ClassfileParser(
10391039
// attribute isn't, this classfile is a compilation artifact.
10401040
return Some(NoEmbedded)
10411041

1042-
if (scan(tpnme.ScalaSignatureATTR) && scan(tpnme.RuntimeVisibleAnnotationATTR)) {
1042+
if (scan(tpnme.ScalaSignatureATTR)) {
1043+
if !scan(tpnme.RuntimeVisibleAnnotationATTR) then
1044+
report.error(em"No RuntimeVisibleAnnotations in classfile with ScalaSignature attribute: ${classRoot.fullName}")
1045+
return None
10431046
val attrLen = in.nextInt
10441047
val nAnnots = in.nextChar
10451048
var i = 0

0 commit comments

Comments
 (0)