Skip to content

Commit 9df73b9

Browse files
authored
Merge pull request #260 from scala/newCollectionsBootstrap
Move to Scala 2.13.0-M5
2 parents 246634d + 270e9cd commit 9df73b9

File tree

11 files changed

+26
-17
lines changed

11 files changed

+26
-17
lines changed

.travis.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jdk:
1616
scala:
1717
- 2.11.12
1818
- 2.12.6
19-
- 2.13.0-M4
19+
- 2.13.0-M5
2020

2121
env:
2222
global:
@@ -30,23 +30,23 @@ env:
3030
# The empty SCALAJS_VERSION will only compile for the JVM
3131
- SCALAJS_VERSION=
3232
- SCALAJS_VERSION=0.6.25
33-
- SCALAJS_VERSION=1.0.0-M5
33+
- SCALAJS_VERSION=1.0.0-M6
3434

3535
matrix:
3636
exclude:
3737
- jdk: openjdk11
3838
env: SCALAJS_VERSION=0.6.25
3939
- jdk: openjdk11
40-
env: SCALAJS_VERSION=1.0.0-M5
40+
env: SCALAJS_VERSION=1.0.0-M6
4141
- scala: 2.11.12
42-
env: SCALAJS_VERSION=1.0.0-M5
42+
env: SCALAJS_VERSION=1.0.0-M6
4343
- scala: 2.11.12
4444
jdk: oraclejdk8
4545
- scala: 2.11.12
4646
jdk: openjdk11
4747
- scala: 2.12.6
4848
jdk: openjdk6
49-
- scala: 2.13.0-M4
49+
- scala: 2.13.0-M5
5050
jdk: openjdk6
5151

5252
script:

build.sbt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sbtcrossproject.{crossProject, CrossType}
22
import ScalaModulePlugin._
33

4-
crossScalaVersions in ThisBuild := List("2.12.6", "2.11.12", "2.13.0-M4")
4+
crossScalaVersions in ThisBuild := List("2.12.6", "2.11.12", "2.13.0-M5")
55

66
lazy val xml = crossProject(JSPlatform, JVMPlatform)
77
.withoutSuffixFor(JVMPlatform)
@@ -19,7 +19,7 @@ lazy val xml = crossProject(JSPlatform, JVMPlatform)
1919
scalacOptions in Test += "-Xxml:coalescing",
2020

2121
mimaPreviousVersion := {
22-
if (System.getenv("SCALAJS_VERSION") == "1.0.0-M5") None // No such release yet
22+
if (System.getenv("SCALAJS_VERSION") == "1.0.0-M6") None // No such release yet
2323
else Some("1.1.1")
2424
},
2525

project/plugins.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ val scalaJSVersion =
99
Option(System.getenv("SCALAJS_VERSION")).filter(_.nonEmpty).getOrElse("0.6.25")
1010

1111
addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)
12-
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.5.0")
12+
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.0")
1313
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "1.0.14")

shared/src/main/scala-2.11-2.12/scala/xml/ScalaVersionSpecific.scala

+4
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ private[xml] trait ScalaVersionSpecificNodeSeq extends SeqLike[Node, NodeSeq] {
2020
private[xml] trait ScalaVersionSpecificNodeBuffer { self: NodeBuffer =>
2121
override def stringPrefix: String = "NodeBuffer"
2222
}
23+
24+
private[xml] trait ScalaVersionSpecificIterableSerializable[+A] { // extends Iterable[A] {
25+
// protected[this] override def writeReplace(): AnyRef = this
26+
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package scala.xml
22

33
import scala.collection.immutable.StrictOptimizedSeqOps
4-
import scala.collection.{SeqOps, immutable, mutable}
4+
import scala.collection.{SeqOps, IterableOnce, immutable, mutable}
55
import scala.collection.BuildFrom
66
import scala.collection.mutable.Builder
77

@@ -10,17 +10,21 @@ private[xml] object ScalaVersionSpecific {
1010
type CBF[-From, -A, +C] = BuildFrom[From, A, C]
1111
object NodeSeqCBF extends BuildFrom[Coll, Node, NodeSeq] {
1212
def newBuilder(from: Coll): Builder[Node, NodeSeq] = NodeSeq.newBuilder
13-
def fromSpecificIterable(from: Coll)(it: Iterable[Node]): NodeSeq = (NodeSeq.newBuilder ++= from).result()
13+
def fromSpecific(from: Coll)(it: IterableOnce[Node]): NodeSeq = (NodeSeq.newBuilder ++= from).result()
1414
}
1515
}
1616

1717
private[xml] trait ScalaVersionSpecificNodeSeq
1818
extends SeqOps[Node, immutable.Seq, NodeSeq]
1919
with StrictOptimizedSeqOps[Node, immutable.Seq, NodeSeq] { self: NodeSeq =>
20-
override def fromSpecificIterable(coll: Iterable[Node]): NodeSeq = (NodeSeq.newBuilder ++= coll).result()
20+
override def fromSpecific(coll: IterableOnce[Node]): NodeSeq = (NodeSeq.newBuilder ++= coll).result()
2121
override def newSpecificBuilder: mutable.Builder[Node, NodeSeq] = NodeSeq.newBuilder
2222
}
2323

2424
private[xml] trait ScalaVersionSpecificNodeBuffer { self: NodeBuffer =>
2525
override def className: String = "NodeBuffer"
2626
}
27+
28+
private[xml] trait ScalaVersionSpecificIterableSerializable[+A] extends Iterable[A] {
29+
protected[this] override def writeReplace(): AnyRef = this
30+
}

shared/src/main/scala/scala/xml/Elem.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ object Elem {
3636

3737
def unapplySeq(n: Node) = n match {
3838
case _: SpecialNode | _: Group => None
39-
case _ => Some((n.prefix, n.label, n.attributes, n.scope, n.child))
39+
case _ => Some((n.prefix, n.label, n.attributes, n.scope, n.child.toSeq))
4040
}
4141

4242
import scala.sys.process._

shared/src/main/scala/scala/xml/MetaData.scala

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ abstract class MetaData
8282
extends AbstractIterable[MetaData]
8383
with Iterable[MetaData]
8484
with Equality
85+
with ScalaVersionSpecificIterableSerializable[MetaData]
8586
with Serializable {
8687

8788
/**

shared/src/main/scala/scala/xml/Node.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ object Node {
2424
/** the empty namespace */
2525
val EmptyNamespace = ""
2626

27-
def unapplySeq(n: Node) = Some((n.label, n.attributes, n.child))
27+
def unapplySeq(n: Node) = Some((n.label, n.attributes, n.child.toSeq))
2828
}
2929

3030
/**

shared/src/main/scala/scala/xml/NodeSeq.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ object NodeSeq {
4444
*
4545
* @author Burak Emir
4646
*/
47-
abstract class NodeSeq extends AbstractSeq[Node] with immutable.Seq[Node] with ScalaVersionSpecificNodeSeq with Equality with Serializable {
47+
abstract class NodeSeq extends AbstractSeq[Node] with immutable.Seq[Node] with ScalaVersionSpecificNodeSeq with Equality with ScalaVersionSpecificIterableSerializable[Node] with Serializable {
4848
def theSeq: Seq[Node]
4949
def length = theSeq.length
5050
override def iterator = theSeq.iterator

shared/src/main/scala/scala/xml/QNode.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ package xml
1616
* @author Burak Emir
1717
*/
1818
object QNode {
19-
def unapplySeq(n: Node) = Some((n.scope.getURI(n.prefix), n.label, n.attributes, n.child))
19+
def unapplySeq(n: Node) = Some((n.scope.getURI(n.prefix), n.label, n.attributes, n.child.toSeq))
2020
}

shared/src/test/scala/scala/xml/PatternMatching.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ class PatternMatching extends {
5858

5959
object SafeNodeSeq {
6060
def unapplySeq(any: Any): Option[Seq[Node]] = any match {
61-
case s: Seq[_] => Some(s flatMap (_ match {
61+
case s: Seq[_] => Some((s flatMap (_ match {
6262
case n: Node => n case _ => NodeSeq.Empty
63-
})) case _ => None
63+
})).toSeq) case _ => None
6464
}
6565
}
6666

0 commit comments

Comments
 (0)