You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the reproduction in scala/bug#11679, an SBT build that uses
`--release 8` and as such does not have `sun._` on the classpath,
`APIPhase` (a custom compiler phase in SBT/Zinc that serializes the API
of each file to perform change detection in incremental compilation)
is attempting to serialize the API of the member
`@CallerSensitive ClassLoader getParent` that
`de.sciss.synth.proc.impl.MemoryClassLoader` inherits from
`j.l.ClassLoader`.
Until that point, scalac was doing okay without having a classfile
for `CallerSensitve` -- it just used a `StubSymbol` in its place.
Scala's pickle phase only serializes `.decls`, not `.members`.
When `APIPhase` filters the list of annotations:
https://github.com/sbt/zinc/blob/4b414b6677/internal/compiler-bridge/src/main/scala/xsbt/ExtractAPI.scala#L789-L800
for those that extend `scala.StaticAnnotation`, the stub symbol fails
and aborts compilation. Static annotations are part of the API because
the are could affect how client code is compiled.
This commit changes `AnnotationInfo.isStatic` to return false
for annotations to absent classfiles. It also makes sure that we
still have a hard-error if annotations based on absent classfiles
are processed by the pickle phase.
I have manually tested this commit with the SBT project in the bug.
Fixesscala/bug#11679
0 commit comments