Skip to content

Commit

Permalink
Ignore stub symbols when API hashing annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
retronym committed Oct 11, 2019
1 parent 9f09d00 commit 2097464
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internal/compiler-bridge/src/main/scala/xsbt/ExtractAPI.scala
Original file line number Diff line number Diff line change
Expand Up @@ -795,8 +795,16 @@ class ExtractAPI[GlobalType <: Global](
ann.atp.typeSymbol isNonBottomSubClass definitions.StaticAnnotationClass
}
implicit def compat(ann: AnnotationInfo): IsStatic = new IsStatic(ann)
annotations.filter(_.isStatic)

// scala/bug#11679 annotations of inherited members may be absent from the compile time classpath
// so avoid calling `isNonBottomSubClass` on these stub symbols which would trigger a fatal error.
annotations.filter(ann => !isStub(ann.atp.typeSymbol) && ann.isStatic)
}

private def isStub(sym: Symbol): Boolean = sym match {
case _: StubSymbol => true
case _ => false
}
}

object ExtractAPI {
Expand Down

0 comments on commit 2097464

Please sign in to comment.