Skip to content

Commit 4429d73

Browse files
authored
Fail early & more clearly on shaded-broken classfiles (#21262)
2 parents 3dfd762 + cecfa8c commit 4429d73

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala

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

1166-
if (scan(tpnme.ScalaSignatureATTR) && scan(tpnme.RuntimeVisibleAnnotationATTR)) {
1166+
if (scan(tpnme.ScalaSignatureATTR)) {
1167+
if !scan(tpnme.RuntimeVisibleAnnotationATTR) then
1168+
report.error(em"No RuntimeVisibleAnnotations in classfile with ScalaSignature attribute: ${classRoot.fullName}")
1169+
return None
11671170
val attrLen = in.nextInt
11681171
val nAnnots = in.nextChar
11691172
var i = 0

0 commit comments

Comments
 (0)