From af7b40a901a1d986dbd0d676d57752dcb57b15e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Doeraene?= Date: Sat, 4 Apr 2026 18:20:46 +0200 Subject: [PATCH 1/2] Fix #464: Deal with so-called CompactAnnotation's. --- .../tastyquery/reader/tasties/TreeUnpickler.scala | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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 From 700ce0bec905dba0efc4f2b60e9781b129bc0087 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Doeraene?= Date: Sat, 4 Apr 2026 17:18:38 +0200 Subject: [PATCH 2/2] Upgrade to Scala 3.8.3. --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"