Skip to content
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

Upgrade to 2.13.0 (and the new collections) #148

Closed
wants to merge 2 commits into from
Closed
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
14 changes: 12 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import ScalaModulePlugin._

resolvers in ThisBuild += "scala-pr" at "https://scala-ci.typesafe.com/artifactory/scala-integration/"

scalaVersionsByJvm in ThisBuild := {
val v211 = "2.11.12"
val v212 = "2.12.4"
val v213 = "2.13.0-M3"
val v213 = "2.13.0-pre-66da69b"

Map(
6 -> List(v211 -> true),
Expand Down Expand Up @@ -38,7 +40,15 @@ lazy val `scala-parser-combinators` = crossProject.in(file(".")).
"Scala Parser Combinators",
"-doc-version",
version.value
)
),
unmanagedSourceDirectories in Compile ++= {
(unmanagedSourceDirectories in Compile).value.map { dir =>
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 13)) => file(dir.getPath ++ "-2.13")
case _ => file(dir.getPath ++ "-2.11-2.12")
}
}
}
).
jvmSettings(
OsgiKeys.exportPackage := Seq(s"scala.util.parsing.*;version=${version.value}"),
Expand Down
4 changes: 2 additions & 2 deletions jvm/src/test/scala/scala/util/parsing/combinator/t4929.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import scala.util.parsing.json._
import java.util.concurrent._
import collection.JavaConversions._
import collection.JavaConverters._

import org.junit.Test

Expand Down Expand Up @@ -36,6 +36,6 @@ class t4929 {
thread.setDaemon(true)
thread.start()
}
errors foreach { throw(_) }
errors.asScala foreach { throw(_) }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package scala.util.parsing.input

private[input] trait ScalaVersionSpecificPagedSeq[T] {
// Nothing for 2.11 and 2.12!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package scala.util.parsing.input

private[input] trait ScalaVersionSpecificPagedSeq[T] { self: PagedSeq[T] =>
// Members declared in scala.collection.Seq
override def iterableFactory: collection.SeqFactory[collection.IndexedSeq] = collection.IndexedSeq

Choose a reason for hiding this comment

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

@julienrf why is this required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe this is not anymore required, actually. Because we override it with the same body as the inherited one…


}
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class PagedSeq[T: ClassTag] protected(
end: Int)
extends scala.collection.AbstractSeq[T]
with scala.collection.IndexedSeq[T]
with ScalaVersionSpecificPagedSeq[T]
{
def this(more: (Array[T], Int, Int) => Int) = this(more, new Page[T](0), 0, UndeterminedEnd)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class UnitTestIO {
val s = "Here is a test string"
val f = io.Source.fromBytes(s.getBytes("utf-8"))
val b = new collection.mutable.ArrayBuffer[Char]()
f.copyToBuffer(b)
b ++= f
assertEquals(new String(b.toArray), s)
}
}