Skip to content

Upgrade to Scala 3.7.0 #454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
10 changes: 6 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.0"
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", "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)
))
Expand Down Expand Up @@ -126,10 +126,12 @@ lazy val tastyQuery =
mimaBinaryIssueFilters ++= {
import com.typesafe.tools.mima.core.*
Seq(
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
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 @@ -140,6 +140,7 @@ private[reader] object ClassfileParser {
val bytesArrArg = scalaSigAnnotation.values.head._2.asInstanceOf[AnnotationValue.Arr]
val idxs = bytesArrArg.values.map(_.asInstanceOf[AnnotationValue.Const].valueIdx)
pool.sigbytes(idxs)
case _: SimpleName => failNoAnnot()
Copy link
Author

Choose a reason for hiding this comment

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

This was reported as an inexhaustive match. I figured failing seemed reasonable but I'm happy to change it if you think there's a better option @sjrd

}
Unpickler.loadInfo(sigBytes)
}
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
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
Loading