diff --git a/build.sbt b/build.sbt index 0672200f..e2ec4c8a 100644 --- a/build.sbt +++ b/build.sbt @@ -3,7 +3,7 @@ import sbt.internal.util.ManagedLogger import org.scalajs.jsenv.nodejs.NodeJSEnv -val usedScalaCompiler = "3.8.1" +val usedScalaCompiler = "3.8.3" val usedTastyRelease = usedScalaCompiler val scala2Version = "2.13.18" diff --git a/tasty-query/shared/src/main/scala/tastyquery/reader/tasties/TreeUnpickler.scala b/tasty-query/shared/src/main/scala/tastyquery/reader/tasties/TreeUnpickler.scala index 34e9aaa2..ccc97a32 100644 --- a/tasty-query/shared/src/main/scala/tastyquery/reader/tasties/TreeUnpickler.scala +++ b/tasty-query/shared/src/main/scala/tastyquery/reader/tasties/TreeUnpickler.scala @@ -397,10 +397,18 @@ private[tasties] class TreeUnpickler private ( private def readAnnotation()(using SourceFile): Annotation = val end = reader.readEnd() skipTree() // skip the typeref to the annotation class; we only use the tree - val tree = readTerm - Annotation(tree) + + if isCompactAnnotTypeTag(reader.nextByte) then + // #464 Apparently we can have CompactAnnotations anyway? + Annotation.fromAnnotTypeAndArgs(readTrueType(), Nil) + else Annotation(readTerm) end readAnnotation + /** Can `tag` start a type argument of a CompactAnnotation? */ + private def isCompactAnnotTypeTag(tag: Int): Boolean = tag match + case APPLIEDtype | SHAREDtype | TYPEREF | TYPEREFdirect | TYPEREFsymbol | TYPEREFin => true + case _ => false + /** Performs the read action as if SHARED tags were transparent: * - follows the SHARED tags to the term or type that is shared * - reads the shared term or type with {@code read} action