Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import sbt.internal.util.ManagedLogger

import org.scalajs.jsenv.nodejs.NodeJSEnv

val usedScalaCompiler = "3.6.2"
val usedScalaCompiler = "3.7.1"
val usedTastyRelease = usedScalaCompiler
val scala2Version = "2.13.14"
val scala2Version = "2.13.16"

val SourceDeps = config("sourcedeps").hide

Expand Down Expand Up @@ -37,7 +37,7 @@ inThisBuild(Def.settings(
Developer("sjrd", "Sébastien Doeraene", "[email protected]", url("https://github.com/sjrd/")),
Developer("bishabosha", "Jamie Thompson", "[email protected]", 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)
))
Expand Down Expand Up @@ -126,10 +126,13 @@ lazy val tastyQuery =
mimaBinaryIssueFilters ++= {
import com.typesafe.tools.mima.core.*
Seq(
// val in a private class; no issue
ProblemFilters.exclude[IncompatibleResultTypeProblem]("tastyquery.reader.tasties.TreeUnpickler#Caches.declaredTopLevelClasses"),
)
},

tastyMiMaPreviousArtifacts := mimaPreviousArtifacts.value,
// Temporarily disabled until we have a published version of tasty-query that can handle 3.7.x.
// tastyMiMaPreviousArtifacts := mimaPreviousArtifacts.value,
tastyMiMaTastyQueryVersionOverride := Some("1.5.0"),
tastyMiMaConfig ~= { prev =>
import tastymima.intf._
Expand Down Expand Up @@ -162,6 +165,13 @@ lazy val tastyQuery =
scalaJSUseMainModuleInitializer := true,
scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule)),
jsEnv := new NodeJSEnv(NodeJSEnv.Config().withArgs(List("--enable-source-maps"))),

/* sbt-version-policy seems to think that the scalajs-scalalib is versioned
* according to the "strict" policy, although the pom files declare "semver-spec".
* We force it to "always" so that it does not report false positives.
* We trust Scala.js core to never break backward compatibility anyway.
*/
libraryDependencySchemes += "org.scala-js" % "scalajs-scalalib_2.13" % "always",
)

def extractRTJar(targetRTJar: File): Unit = {
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.19.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.4")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private[reader] object ClassfileParser {
.use(ClassfileReader.readAnnotation(Set(annot.ScalaLongSignature, annot.ScalaSignature)))
.getOrElse(failNoAnnot())

val sigBytes = scalaSigAnnotation.tpe match {
val sigBytes = (scalaSigAnnotation.tpe: @unchecked) match {
case annot.ScalaSignature =>
val bytesArg = scalaSigAnnotation.values.head._2.asInstanceOf[AnnotationValue.Const]
pool.sigbytes(bytesArg.valueIdx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ private[pickles] class PickleReader {
private var frozenSymbols: Boolean = false

/** The map from created local symbols to the address of their info, until it gets read. */
private val localSymbolInfoRefs = mutable.AnyRefMap.empty[TermOrTypeSymbol, Int]
private val localSymbolInfoRefs = mutable.HashMap.empty[TermOrTypeSymbol, Int]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mutable.AnyRefMap was deprecated in scala/scala#10862 and now encourages use of mutable.HashMap


private val localClassGivenSelfTypeRefs = mutable.AnyRefMap.empty[ClassSymbol, Int]
private val localClassGivenSelfTypeRefs = mutable.HashMap.empty[ClassSymbol, Int]

final class Structure(using val myEntries: Entries, val myIndex: Index):
def allRegisteredSymbols: Iterator[TermOrTypeSymbol] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private[reader] object Unpickler {
}

// Read the annotations to give to the symbols we read
val annotationMap = mutable.AnyRefMap.empty[TermOrTypeSymbol, List[Annotation]]
val annotationMap = mutable.HashMap.empty[TermOrTypeSymbol, List[Annotation]]
index.loopWithIndices { (offset, i) =>
if reader.isSymbolAnnotationEntry(i) then
pkl.unsafeFork(offset) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ private[tasties] object TastyFormat:
* compatibility, but remains backwards compatible, with all
* preceeding `MinorVersion`.
*/
final val MinorVersion: Int = 6
final val MinorVersion: Int = 7

/** Natural Number. The `ExperimentalVersion` allows for
* experimentation with changes to TASTy without committing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1806,7 +1806,7 @@ private[tasties] object TreeUnpickler {
*
* This is used in `readWithin` to resolve top-level class references without a Context.
*/
val declaredTopLevelClasses = mutable.AnyRefMap.empty[(PackageSymbol, TypeName), ClassSymbol]
val declaredTopLevelClasses = mutable.HashMap.empty[(PackageSymbol, TypeName), ClassSymbol]

def hasSymbolAt(addr: Addr): Boolean = localSymbols.contains(addr)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class PrintersTest extends UnrestrictedUnpicklingSuite:
testShowBasicMember(
MatchTypeClass,
typeName("MTWithBind"),
"type MTWithBind[X] <: t = X match { case List[t] => t }"
"type MTWithBind[X] = X match { case List[t] => t }"
)
}

Expand Down Expand Up @@ -315,7 +315,7 @@ class PrintersTest extends UnrestrictedUnpicklingSuite:
testShowMultilineMember(
MatchTypeClass,
typeName("MTWithBind"),
"""type MTWithBind[X] <: t = X match {
"""type MTWithBind[X] = X match {
| case List[t] => t
|}""".stripMargin
)
Expand Down