From aa2b2083bba44570efa193d0eec86a8ef5a3f0a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Doeraene?= Date: Tue, 9 Jun 2026 11:59:13 +0200 Subject: [PATCH 1/3] Set the version policy intention to BinaryCompatible for upcoming changes. --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 19bdea2a..45784503 100644 --- a/build.sbt +++ b/build.sbt @@ -37,7 +37,7 @@ inThisBuild(Def.settings( Developer("sjrd", "Sébastien Doeraene", "sjrdoeraene@gmail.com", url("https://github.com/sjrd/")), Developer("bishabosha", "Jamie Thompson", "bishbashboshjt@gmail.com", url("https://github.com/bishabosha")), ), - versionPolicyIntention := Compatibility.BinaryAndSourceCompatible, + versionPolicyIntention := Compatibility.BinaryCompatible, // Ignore dependencies to internal modules whose version is like `1.2.3+4...` (see https://github.com/scalacenter/sbt-version-policy#how-to-integrate-with-sbt-dynver) versionPolicyIgnoredInternalDependencyVersions := Some("^\\d+\\.\\d+\\.\\d+\\+\\d+".r) )) From 15a4485dd6a6bb05906a0e04a65b7ea888310505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Doeraene?= Date: Thu, 16 Jul 2026 17:14:33 +0200 Subject: [PATCH 2/3] Upgrade to Scala.js 1.22.0. --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 86439fe5..5dfcabea 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,4 @@ -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.20.2") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.22.0") addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.4") From 884eb17273ba880f3ebd2218f70504896ef9f85a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Doeraene?= Date: Tue, 9 Jun 2026 11:49:23 +0200 Subject: [PATCH 3/3] WiP Upgrade to Scala 3.9.0 and support its TASTy. Temporarily disable tasty-mima until we have a new published release of tasty-query. WiP: currently 3.9.0-RC4. --- build.sbt | 5 +++-- .../tastyquery/reader/tasties/TastyFormat.scala | 4 ++-- .../reader/tasties/TreeUnpickler.scala | 17 +++++++++-------- .../test/scala/tastyquery/SubtypingSuite.scala | 2 +- .../scala/simple_trees/EvilClassNames.scala | 8 ++++---- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/build.sbt b/build.sbt index 45784503..1bbdc8e5 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.3" +val usedScalaCompiler = "3.9.0-RC4" val usedTastyRelease = usedScalaCompiler val scala2Version = "2.13.18" @@ -130,7 +130,8 @@ lazy val tastyQuery = ) }, - tastyMiMaPreviousArtifacts := mimaPreviousArtifacts.value, + // Temporarily disabled until we have a published version of tasty-query that can handle 3.8.x. + // tastyMiMaPreviousArtifacts := mimaPreviousArtifacts.value, tastyMiMaTastyQueryVersionOverride := Some("1.8.0"), tastyMiMaConfig ~= { prev => import tastymima.intf._ diff --git a/tasty-query/shared/src/main/scala/tastyquery/reader/tasties/TastyFormat.scala b/tasty-query/shared/src/main/scala/tastyquery/reader/tasties/TastyFormat.scala index 245c3309..fc466ddb 100644 --- a/tasty-query/shared/src/main/scala/tastyquery/reader/tasties/TastyFormat.scala +++ b/tasty-query/shared/src/main/scala/tastyquery/reader/tasties/TastyFormat.scala @@ -297,7 +297,7 @@ private[tasties] object TastyFormat: * compatibility, but remains backwards compatible, with all * preceeding `MinorVersion`. */ - final val MinorVersion: Int = 8 + final val MinorVersion: Int = 9 /** Natural Number. The `ExperimentalVersion` allows for * experimentation with changes to TASTy without committing @@ -313,7 +313,7 @@ private[tasties] object TastyFormat: * is able to read final TASTy documents if the file's * `MinorVersion` is strictly less than the current value. */ - final val ExperimentalVersion: Int = 0 + final val ExperimentalVersion: Int = 1 /** This method implements a binary relation (`<:<`) between two TASTy versions. * 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 a6de7eee..47356414 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 @@ -386,7 +386,7 @@ private[tasties] class TreeUnpickler private ( case PRIVATEqualified | PROTECTEDqualified => privateWithin = Some(readWithin(sym)) case ANNOTATION => - annots ::= readAnnotation() + annots ::= readAnnotationInModifiers() case _ => () end while @@ -394,13 +394,14 @@ private[tasties] class TreeUnpickler private ( sym.setPrivateWithin(privateWithin).setAnnotations(annots) end readAnnotationsInModifiers - private def readAnnotation()(using SourceFile): Annotation = - val end = reader.readEnd() + private def readAnnotationInModifiers()(using SourceFile): Annotation = + reader.readEnd() skipTree() // skip the typeref to the annotation class; we only use the tree + readAnnotation() + end readAnnotationInModifiers - if isCompactAnnotTypeTag(reader.nextByte) then - // #464 Apparently we can have CompactAnnotations anyway? - Annotation.fromAnnotTypeAndArgs(readTrueType(), Nil) + private def readAnnotation()(using SourceFile): Annotation = + if isCompactAnnotTypeTag(reader.nextByte) then Annotation.fromAnnotTypeAndArgs(readTrueType(), Nil) else Annotation(readTerm) end readAnnotation @@ -1344,8 +1345,8 @@ private[tasties] class TreeUnpickler private ( reader.readByte() reader.readEnd() val typ = readTrueType() - val annot = readTerm - AnnotatedType(typ, Annotation(annot)) + val annot = readAnnotation() + AnnotatedType(typ, annot) case ANDtype => reader.readByte() reader.readEnd() diff --git a/tasty-query/shared/src/test/scala/tastyquery/SubtypingSuite.scala b/tasty-query/shared/src/test/scala/tastyquery/SubtypingSuite.scala index 8c4137a4..a227ec17 100644 --- a/tasty-query/shared/src/test/scala/tastyquery/SubtypingSuite.scala +++ b/tasty-query/shared/src/test/scala/tastyquery/SubtypingSuite.scala @@ -970,7 +970,7 @@ class SubtypingSuite extends UnrestrictedUnpicklingSuite: ctx.findTopLevelClass("simple_trees.GenericMethodWithTypeParamDependencies") val foo = GenericMethodWithTypeParamDependenciesClass.findNonOverloadedDecl(termName("foo")) - val DefDef(_, Right(typeParams) :: Left(Nil) :: Nil, _, _, _$1) = foo.tree.get: @unchecked + val DefDef(_, Right(typeParams) :: Left(Nil) :: Nil, _, _, _) = foo.tree.get: @unchecked locally { val List(a, b, c, d) = typeParams.map(_.symbol): @unchecked diff --git a/test-sources/src/main/scala/simple_trees/EvilClassNames.scala b/test-sources/src/main/scala/simple_trees/EvilClassNames.scala index 902d2aca..b76ae17a 100644 --- a/test-sources/src/main/scala/simple_trees/EvilClassNames.scala +++ b/test-sources/src/main/scala/simple_trees/EvilClassNames.scala @@ -1,10 +1,10 @@ package simple_trees -class evil_$_class: - class evil_$_inner +class `evil_$_class`: + class `evil_$_inner` -trait evil_$_trait: - class evil_$_inner +trait `evil_$_trait`: + class `evil_$_inner` object EvilClassNames: class SubEvilClass extends evil_$_class