Skip to content

Commit 9646273

Browse files
committed
update Using from Scala 2.13.17 and add UsingTest
fixes #692 copies the sources from scala/scala repo, reformatted using scalafmt both `Using` and `UsingTest` needed slight adjustment to compile on 2.11 and 2.12; and `UsingTest` needed to be adjusted to use scala.util.control.compat.ControlThrowable includes Scala upgrades: Scala 2.13.17, 2.12.20 (was .13, .19), Scala.js (because only latest Scala.js is available for 2.13.17)
1 parent 484a621 commit 9646273

File tree

5 files changed

+718
-693
lines changed

5 files changed

+718
-693
lines changed

build.sbt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ lazy val root = project
5050
lazy val junit = libraryDependencies += "com.github.sbt" % "junit-interface" % "0.13.3" % Test
5151

5252
lazy val scala211 = "2.11.12"
53-
lazy val scala212 = "2.12.19"
54-
lazy val scala213 = "2.13.13"
53+
lazy val scala212 = "2.12.20"
54+
lazy val scala213 = "2.13.17"
5555
lazy val scala3 = "3.3.6"
5656

5757
lazy val compat = new MultiScalaCrossProject(
@@ -63,6 +63,16 @@ lazy val compat = new MultiScalaCrossProject(
6363
moduleName := "scala-collection-compat",
6464
scalaModuleAutomaticModuleName := Some("scala.collection.compat"),
6565
scalacOptions ++= Seq("-feature", "-language:higherKinds", "-language:implicitConversions"),
66+
// we need to force Scala 3 to use the latest Scala 2 stdlib, otherwise
67+
// we might get test failures if there are behavior changes in latest Scala 2 stdlib
68+
dependencyOverrides ++= {
69+
CrossVersion.partialVersion(scalaVersion.value) match {
70+
case Some((3, _)) =>
71+
Seq("org.scala-lang" % "scala-library" % scala213)
72+
case _ =>
73+
Seq()
74+
}
75+
},
6676
Compile / unmanagedSourceDirectories += {
6777
val sharedSourceDir = (ThisBuild / baseDirectory).value / "compat/src/main"
6878
CrossVersion.partialVersion(scalaVersion.value) match {

0 commit comments

Comments
 (0)