Skip to content

Commit

Permalink
Fail early & more clearly on shaded-broken classfiles (#21262)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwijnand authored Jul 29, 2024
2 parents 3dfd762 + cecfa8c commit 4429d73
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,10 @@ class ClassfileParser(
// attribute isn't, this classfile is a compilation artifact.
return Some(NoEmbedded)

if (scan(tpnme.ScalaSignatureATTR) && scan(tpnme.RuntimeVisibleAnnotationATTR)) {
if (scan(tpnme.ScalaSignatureATTR)) {
if !scan(tpnme.RuntimeVisibleAnnotationATTR) then
report.error(em"No RuntimeVisibleAnnotations in classfile with ScalaSignature attribute: ${classRoot.fullName}")
return None
val attrLen = in.nextInt
val nAnnots = in.nextChar
var i = 0
Expand Down

0 comments on commit 4429d73

Please sign in to comment.