Skip to content

Commit 9f5425f

Browse files
authoredJun 20, 2023
Merge pull request #675 from dubinsky/version-dependent-types
Added all missing type annotations.
2 parents 26af21d + 3742370 commit 9f5425f

26 files changed

+161
-58
lines changed
 

‎.circleci/config.yml

+15-15
Original file line numberDiff line numberDiff line change
@@ -92,56 +92,56 @@ workflows:
9292
build:
9393
jobs:
9494
- scala_job:
95-
name: 2.12.18
95+
name: 2.12.x
9696
java_version: jdk8
9797
scala_version: 2.12.18
9898
- scala_job:
99-
name: 2.13.11
99+
name: 2.13.x
100100
java_version: jdk8
101101
scala_version: 2.13.11
102102
- scala_job:
103-
name: 3.3.0
103+
name: 3.x
104104
java_version: jdk8
105105
scala_version: 3.3.0
106106
- scala_job:
107-
name: jdk11_2.12
107+
name: jdk11_2.12.x
108108
java_version: jdk11
109109
scala_version: 2.12.18
110110
- scala_job:
111-
name: jdk11_2.13
111+
name: jdk11_2.13.x
112112
java_version: jdk11
113113
scala_version: 2.13.11
114114
- scala_job:
115-
name: jdk11_3.1
115+
name: jdk11_3.x
116116
java_version: jdk11
117117
scala_version: 3.3.0
118118
- scala_job:
119-
name: jdk17_2.12
119+
name: jdk17_2.12.x
120120
java_version: jdk17
121121
scala_version: 2.12.18
122122
- scala_job:
123-
name: jdk17_2.13
123+
name: jdk17_2.13.x
124124
java_version: jdk17
125125
scala_version: 2.13.11
126126
- scala_job:
127-
name: jdk17_3.3
127+
name: jdk17_3.x
128128
java_version: jdk17
129129
scala_version: 3.3.0
130130
- scalajs_job:
131-
name: sjs1.0_2.12
131+
name: sjs1.0_2.12.x
132132
scala_version: 2.12.18
133133
- scalajs_job:
134-
name: sjs1.0_2.13
134+
name: sjs1.0_2.13.x
135135
scala_version: 2.13.11
136136
- scalajs_job:
137-
name: sjs1.0_3.3
137+
name: sjs1.0_3.x
138138
scala_version: 3.3.0
139139
- scalanative_job:
140-
name: native0.4_2.12
140+
name: native0.4_2.12.x
141141
scala_version: 2.12.18
142142
- scalanative_job:
143-
name: native0.4_2.13
143+
name: native0.4_2.13.x
144144
scala_version: 2.13.11
145145
- scalanative_job:
146-
name: native0.4_3
146+
name: native0.4_3.x
147147
scala_version: 3.3.0

‎build.sbt

+27-19
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ ThisBuild / licenses += (("Apache-2.0", url("https://www.apache.org/licenses/LIC
99
ThisBuild / libraryDependencySchemes += "org.scala-js" %% "scalajs-library" % "semver-spec"
1010
ThisBuild / apiURL := Some(url("https://javadoc.io/doc/org.scala-lang.modules/scala-xml_2.13/"))
1111

12-
lazy val configSettings: Seq[Setting[_]] = Seq(
12+
lazy val configSettings: Seq[Setting[?]] = Seq(
1313
unmanagedSourceDirectories ++= {
1414
unmanagedSourceDirectories.value.flatMap { dir =>
15-
val sv = scalaVersion.value
16-
Seq(
17-
CrossVersion.partialVersion(sv) match {
18-
case Some((major, minor)) if major > 2 || (major == 2 && minor >= 13) => file(dir.getPath ++ "-2.13+")
19-
case _ => file(dir.getPath ++ "-2.13-")
20-
},
21-
CrossVersion.partialVersion(sv) match {
22-
case Some((2, _)) => file(dir.getPath ++ "-2.x")
23-
case _ => file(dir.getPath ++ "-3.x")
24-
}
25-
)
15+
def forVersion(version: String): File = file(dir.getPath ++ "-" ++ version)
16+
CrossVersion.partialVersion(scalaVersion.value) match {
17+
case Some((3, _)) => Seq(forVersion("3"), forVersion("2.13+"))
18+
case Some((2, minor)) =>
19+
Seq(forVersion("2")) ++ (minor match {
20+
case 13 => Seq(forVersion("2.13"), forVersion("2.13+"))
21+
case 12 => Seq(forVersion("2.12"))
22+
case _ => Seq()
23+
})
24+
case _ => Seq()
25+
}
2626
}
2727
}
2828
)
@@ -65,13 +65,21 @@ lazy val xml = crossProject(JSPlatform, JVMPlatform, NativePlatform)
6565
versionPolicyIntention := Compatibility.BinaryCompatible,
6666
// Note: See discussion on non-JVM Mima in https://github.com/scala/scala-xml/pull/517
6767
mimaBinaryIssueFilters ++= {
68-
import com.typesafe.tools.mima.core._
69-
import com.typesafe.tools.mima.core.ProblemFilters._
70-
Seq(
71-
// necessitated by the introduction of new abstract methods in FactoryAdapter:
72-
exclude[ReversedMissingMethodProblem]("scala.xml.parsing.FactoryAdapter.createComment"), // see #549
73-
exclude[ReversedMissingMethodProblem]("scala.xml.parsing.FactoryAdapter.createPCData") // see #558
74-
)
68+
//import com.typesafe.tools.mima.core.{}
69+
//import com.typesafe.tools.mima.core.ProblemFilters
70+
Seq( // exclusions for all Scala versions
71+
) ++ (CrossVersion.partialVersion(scalaVersion.value) match {
72+
case Some((3, _)) => Seq( // Scala 3-specific exclusions
73+
)
74+
case Some((2, minor)) => Seq( // Scala 2-specific exclusions
75+
) ++ (minor match {
76+
case 13 => Seq( // Scala 2.13-specific exclusions
77+
)
78+
case 12 => Seq( // Scala 2.12-specific exclusions
79+
)
80+
})
81+
case _ => Seq()
82+
})
7583
},
7684
// Mima signature checking stopped working after 3.0.2 upgrade, see #557
7785
mimaReportSignatureProblems := (CrossVersion.partialVersion(scalaVersion.value) match {

‎shared/src/main/scala-2.13-/scala/xml/ScalaVersionSpecific.scala renamed to ‎shared/src/main/scala-2.12/scala/xml/ScalaVersionSpecific.scala

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ private[xml] object ScalaVersionSpecific {
2222
override def apply(from: Coll): mutable.Builder[Node, NodeSeq] = NodeSeq.newBuilder
2323
override def apply(): mutable.Builder[Node, NodeSeq] = NodeSeq.newBuilder
2424
}
25+
type SeqNodeUnapplySeq = scala.collection.Seq[Node]
2526
}
2627

2728
private[xml] trait ScalaVersionSpecificNodeSeq extends SeqLike[Node, NodeSeq] { self: NodeSeq =>

‎shared/src/main/scala-2.13+/scala/xml/ScalaVersionSpecific.scala

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ private[xml] object ScalaVersionSpecific {
2424
def newBuilder(from: Coll): Builder[Node, NodeSeq] = NodeSeq.newBuilder
2525
def fromSpecific(from: Coll)(it: IterableOnce[Node]): NodeSeq = (NodeSeq.newBuilder ++= from).result()
2626
}
27+
type SeqNodeUnapplySeq = scala.collection.immutable.Seq[Node]
2728
}
2829

2930
private[xml] trait ScalaVersionSpecificNodeSeq
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Scala (https://www.scala-lang.org)
3+
*
4+
* Copyright EPFL and Lightbend, Inc.
5+
*
6+
* Licensed under Apache License 2.0
7+
* (http://www.apache.org/licenses/LICENSE-2.0).
8+
*
9+
* See the NOTICE file distributed with this work for
10+
* additional information regarding copyright ownership.
11+
*/
12+
13+
package scala.xml
14+
15+
/*
16+
Unlike other Scala-version-specific things, this class is not filling any gaps in capabilities
17+
between different versions of Scala; instead, it mostly documents the types that different versions of the
18+
Scala compiler inferred in the unfortunate absence of the explicit type annotations.
19+
What should have been specified explicitly is given in the comments;
20+
next time we break binary compatibility the types should be changed in the code and this class removed.
21+
*/
22+
private[xml] object ScalaVersionSpecificReturnTypes { // should be
23+
type ExternalIDAttribute = MetaData // Null.type
24+
type NoExternalIDId = scala.Null
25+
type NodeNoAttributes = MetaData // Null.type
26+
type NullFilter = MetaData // Null.type
27+
type NullGetNamespace = scala.Null
28+
type NullNext = scala.Null
29+
type NullKey = scala.Null
30+
type NullValue = scala.Null
31+
type NullApply1 = scala.collection.Seq[Node] // scala.Null
32+
type NullApply3 = scala.Null
33+
type NullRemove = Null.type
34+
type SpecialNodeChild = Nil.type
35+
type GroupChild = Nothing
36+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Scala (https://www.scala-lang.org)
3+
*
4+
* Copyright EPFL and Lightbend, Inc.
5+
*
6+
* Licensed under Apache License 2.0
7+
* (http://www.apache.org/licenses/LICENSE-2.0).
8+
*
9+
* See the NOTICE file distributed with this work for
10+
* additional information regarding copyright ownership.
11+
*/
12+
13+
package scala.xml
14+
15+
/*
16+
Unlike other Scala-version-specific things, this class is not filling any gaps in capabilities
17+
between different versions of Scala; instead, it mostly documents the types that different versions of the
18+
Scala compiler inferred in the unfortunate absence of the explicit type annotations.
19+
What should have been specified explicitly is given in the comments;
20+
next time we break binary compatibility the types should be changed in the code and this class removed.
21+
*/
22+
private[xml] object ScalaVersionSpecificReturnTypes { // should be
23+
type ExternalIDAttribute = MetaData // Null.type
24+
type NoExternalIDId = String // scala.Null
25+
type NodeNoAttributes = MetaData // Null.type
26+
type NullFilter = MetaData // Null.type
27+
type NullGetNamespace = String // scala.Null
28+
type NullNext = MetaData // scala.Null
29+
type NullKey = String // scala.Null
30+
type NullValue = scala.collection.Seq[Node] // scala.Null
31+
type NullApply1 = scala.collection.Seq[Node] // scala.Null
32+
type NullApply3 = scala.collection.Seq[Node] // scala.Null
33+
type NullRemove = MetaData // Null.type
34+
type SpecialNodeChild = scala.collection.Seq[Node] // Nil.type
35+
type GroupChild = scala.collection.Seq[Node] // Nothing
36+
}

‎shared/src/main/scala/scala/xml/Attribute.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import scala.collection.Seq
2222
* @author Burak Emir
2323
*/
2424
object Attribute {
25-
def unapply(x: Attribute) /* TODO type annotation */ = x match {
25+
def unapply(x: Attribute): Option[(String, Seq[Node], MetaData)] = x match {
2626
case PrefixedAttribute(_, key, value, next) => Some((key, value, next))
2727
case UnprefixedAttribute(key, value, next) => Some((key, value, next))
2828
case _ => None

‎shared/src/main/scala/scala/xml/Comment.scala

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ package xml
2121
* and the final character may not be `-` to prevent a closing span of `-->`
2222
* which is invalid. [[https://www.w3.org/TR/xml11//#IDA5CES]]
2323
*/
24+
// Note: used by the Scala compiler.
2425
case class Comment(commentText: String) extends SpecialNode {
2526

2627
override def label: String = "#REM"

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

+7-4
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,17 @@ import scala.collection.Seq
2121
* any `Node` instance (that is not a `SpecialNode` or a `Group`) using the
2222
* syntax `case Elem(prefix, label, attribs, scope, child @ _*) => ...`
2323
*/
24+
// Note: used by the Scala compiler.
2425
object Elem {
2526

2627
def apply(prefix: String, label: String, attributes: MetaData, scope: NamespaceBinding, minimizeEmpty: Boolean, child: Node*): Elem =
2728
new Elem(prefix, label, attributes, scope, minimizeEmpty, child: _*)
2829

29-
def unapplySeq(n: Node) /* TODO type annotation */ = n match {
30-
case _: SpecialNode | _: Group => None
31-
case _ => Some((n.prefix, n.label, n.attributes, n.scope, n.child.toSeq))
32-
}
30+
def unapplySeq(n: Node): Option[(String, String, MetaData, NamespaceBinding, ScalaVersionSpecific.SeqNodeUnapplySeq)] =
31+
n match {
32+
case _: SpecialNode | _: Group => None
33+
case _ => Some((n.prefix, n.label, n.attributes, n.scope, n.child.toSeq))
34+
}
3335
}
3436

3537
/**
@@ -51,6 +53,7 @@ object Elem {
5153
* empty; `false` if it should be written out in long form.
5254
* @param child the children of this node
5355
*/
56+
// Note: used by the Scala compiler.
5457
class Elem(
5558
override val prefix: String,
5659
override val label: String,

‎shared/src/main/scala/scala/xml/EntityRef.scala

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package xml
1919
* @author Burak Emir
2020
* @param entityName the name of the entity reference, for example `amp`.
2121
*/
22+
// Note: used by the Scala compiler.
2223
case class EntityRef(entityName: String) extends SpecialNode {
2324
final override def doCollectNamespaces: Boolean = false
2425
final override def doTransform: Boolean = false

‎shared/src/main/scala/scala/xml/Group.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import scala.collection.Seq
2020
*
2121
* @author Burak Emir
2222
*/
23+
// Note: used by the Scala compiler.
2324
final case class Group(nodes: Seq[Node]) extends Node {
2425
override def theSeq: Seq[Node] = nodes
2526

@@ -44,6 +45,6 @@ final case class Group(nodes: Seq[Node]) extends Node {
4445
override def label: Nothing = fail("label")
4546
override def attributes: Nothing = fail("attributes")
4647
override def namespace: Nothing = fail("namespace")
47-
override def child /* TODO type annotation */ = fail("child")
48+
override def child: ScalaVersionSpecificReturnTypes.GroupChild = fail("child")
4849
def buildString(sb: StringBuilder): Nothing = fail("toString(StringBuilder)")
4950
}

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

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ object MetaData {
8080
* Namespace URIs are obtained by using the namespace scope of the element
8181
* owning this attribute (see `getNamespace`).
8282
*/
83+
// Note: used by the Scala compiler.
8384
abstract class MetaData
8485
extends AbstractIterable[MetaData]
8586
with Iterable[MetaData]

‎shared/src/main/scala/scala/xml/NamespaceBinding.scala

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import scala.collection.Seq
2323
*
2424
* @author Burak Emir
2525
*/
26+
// Note: used by the Scala compiler.
2627
@SerialVersionUID(0 - 2518644165573446725L)
2728
case class NamespaceBinding(prefix: String, uri: String, parent: NamespaceBinding) extends AnyRef with Equality {
2829
if (prefix == "")

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ import scala.collection.Seq
2323
*/
2424
object Node {
2525
/** the constant empty attribute sequence */
26-
final def NoAttributes: MetaData = Null
26+
final def NoAttributes: ScalaVersionSpecificReturnTypes.NodeNoAttributes = Null
2727

2828
/** the empty namespace */
2929
val EmptyNamespace: String = ""
3030

31-
def unapplySeq(n: Node) /* TODO type annotation */ = Some((n.label, n.attributes, n.child.toSeq))
31+
def unapplySeq(n: Node): Some[(String, MetaData, ScalaVersionSpecific.SeqNodeUnapplySeq)] =
32+
Some((n.label, n.attributes, n.child.toSeq))
3233
}
3334

3435
/**

‎shared/src/main/scala/scala/xml/NodeBuffer.scala

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ package xml
2323
*
2424
* @author Burak Emir
2525
*/
26+
// Note: used by the Scala compiler.
2627
class NodeBuffer extends scala.collection.mutable.ArrayBuffer[Node] with ScalaVersionSpecificNodeBuffer {
2728
/**
2829
* Append given object to this buffer, returns reference on this

‎shared/src/main/scala/scala/xml/Null.scala

+10-9
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,20 @@ import scala.collection.Seq
2323
*
2424
* @author Burak Emir
2525
*/
26+
// Note: used by the Scala compiler.
2627
case object Null extends MetaData {
2728
override def iterator: Iterator[Nothing] = Iterator.empty
2829
override def size: Int = 0
2930
override def append(m: MetaData, scope: NamespaceBinding = TopScope): MetaData = m
30-
override def filter(f: MetaData => Boolean): MetaData = this
31+
override def filter(f: MetaData => Boolean): ScalaVersionSpecificReturnTypes.NullFilter = this
3132

3233
override def copy(next: MetaData): MetaData = next
33-
override def getNamespace(owner: Node) /* TODO type annotation */ = null
34+
override def getNamespace(owner: Node): ScalaVersionSpecificReturnTypes.NullGetNamespace = null
3435

3536
override def hasNext: Boolean = false
36-
override def next /* TODO type annotation */ = null
37-
override def key /* TODO type annotation */ = null
38-
override def value /* TODO type annotation */ = null
37+
override def next: ScalaVersionSpecificReturnTypes.NullNext = null
38+
override def key: ScalaVersionSpecificReturnTypes.NullKey = null
39+
override def value: ScalaVersionSpecificReturnTypes.NullValue = null
3940
override def isPrefixed: Boolean = false
4041

4142
override def length: Int = 0
@@ -47,8 +48,8 @@ case object Null extends MetaData {
4748
}
4849
override protected def basisForHashCode: Seq[Any] = Nil
4950

50-
override def apply(namespace: String, scope: NamespaceBinding, key: String) /* TODO type annotation */ = null
51-
override def apply(key: String) /* TODO type annotation */ =
51+
override def apply(namespace: String, scope: NamespaceBinding, key: String): ScalaVersionSpecificReturnTypes.NullApply3 = null
52+
override def apply(key: String): ScalaVersionSpecificReturnTypes.NullApply1 =
5253
if (Utility.isNameStart(key.head)) null
5354
else throw new IllegalArgumentException("not a valid attribute name '" + key + "', so can never match !")
5455

@@ -61,6 +62,6 @@ case object Null extends MetaData {
6162

6263
override def wellformed(scope: NamespaceBinding): Boolean = true
6364

64-
override def remove(key: String) /* TODO type annotation */ = this
65-
override def remove(namespace: String, scope: NamespaceBinding, key: String) /* TODO type annotation */ = this
65+
override def remove(key: String): ScalaVersionSpecificReturnTypes.NullRemove = this
66+
override def remove(namespace: String, scope: NamespaceBinding, key: String): ScalaVersionSpecificReturnTypes.NullRemove = this
6667
}

‎shared/src/main/scala/scala/xml/PCData.scala

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ package xml
2020
*
2121
* @author Burak Emir
2222
*/
23+
// Note: used by the Scala compiler (before Scala 3).
2324
class PCData(data: String) extends Atom[String](data) {
2425

2526
/**
@@ -39,6 +40,7 @@ class PCData(data: String) extends Atom[String](data) {
3940
*
4041
* @author Burak Emir
4142
*/
43+
// Note: used by the Scala compiler (before Scala 3).
4244
object PCData {
4345
def apply(data: String): PCData = new PCData(data)
4446
def unapply(other: Any): Option[String] = other match {

‎shared/src/main/scala/scala/xml/PrefixedAttribute.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import scala.collection.Seq
2323
* @param value the attribute value
2424
* @param next1
2525
*/
26+
// Note: used by the Scala compiler.
2627
class PrefixedAttribute(
2728
override val pre: String,
2829
override val key: String,
@@ -64,5 +65,5 @@ class PrefixedAttribute(
6465
}
6566

6667
object PrefixedAttribute {
67-
def unapply(x: PrefixedAttribute) /* TODO type annotation */ = Some((x.pre, x.key, x.value, x.next))
68+
def unapply(x: PrefixedAttribute): Some[(String, String, Seq[Node], MetaData)] = Some((x.pre, x.key, x.value, x.next))
6869
}

‎shared/src/main/scala/scala/xml/ProcInstr.scala

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ package xml
2020
* @param target target name of this PI
2121
* @param proctext text contained in this node, may not contain "?>"
2222
*/
23+
// Note: used by the Scala compiler.
2324
case class ProcInstr(target: String, proctext: String) extends SpecialNode {
2425
if (!Utility.isName(target))
2526
throw new IllegalArgumentException(target + " must be an XML Name")

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ package xml
2020
* @author Burak Emir
2121
*/
2222
object QNode {
23-
def unapplySeq(n: Node) /* TODO type annotation */ = Some((n.scope.getURI(n.prefix), n.label, n.attributes, n.child.toSeq))
23+
def unapplySeq(n: Node): Some[(String, String, MetaData, ScalaVersionSpecific.SeqNodeUnapplySeq)] =
24+
Some((n.scope.getURI(n.prefix), n.label, n.attributes, n.child.toSeq))
2425
}

‎shared/src/main/scala/scala/xml/SpecialNode.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ abstract class SpecialNode extends Node {
2828
final override def namespace: scala.Null = null
2929

3030
/** always empty */
31-
final override def child /* TODO type annotation */ = Nil
31+
final override def child: ScalaVersionSpecificReturnTypes.SpecialNodeChild = Nil
3232

3333
/** Append string representation to the given string buffer argument. */
3434
def buildString(sb: StringBuilder): StringBuilder

‎shared/src/main/scala/scala/xml/Text.scala

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ package xml
2020
* @author Burak Emir
2121
* @param data the text contained in this node, may not be null.
2222
*/
23+
// Note: used by the Scala compiler.
2324
class Text(data: String) extends Atom[String](data) {
2425

2526
/**
@@ -36,6 +37,7 @@ class Text(data: String) extends Atom[String](data) {
3637
*
3738
* @author Burak Emir
3839
*/
40+
// Note: used by the Scala compiler.
3941
object Text {
4042
def apply(data: String): Text = new Text(data)
4143
def unapply(other: Any): Option[String] = other match {

‎shared/src/main/scala/scala/xml/Unparsed.scala

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ package xml
2020
* @author Burak Emir
2121
* @param data content in this node, may not be null.
2222
*/
23+
// Note: used by the Scala compiler.
2324
class Unparsed(data: String) extends Atom[String](data) {
2425

2526
/**

‎shared/src/main/scala/scala/xml/UnprefixedAttribute.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import scala.collection.Seq
2020
*
2121
* @author Burak Emir
2222
*/
23+
// Note: used by the Scala compiler.
2324
class UnprefixedAttribute(
2425
override val key: String,
2526
override val value: Seq[Node],
@@ -62,5 +63,5 @@ class UnprefixedAttribute(
6263
next(namespace, scope, key)
6364
}
6465
object UnprefixedAttribute {
65-
def unapply(x: UnprefixedAttribute) /* TODO type annotation */ = Some((x.key, x.value, x.next))
66+
def unapply(x: UnprefixedAttribute): Some[(String, Seq[Node], MetaData)] = Some((x.key, x.value, x.next))
6667
}

‎shared/src/main/scala/scala/xml/dtd/ExternalID.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ case class PublicID(override val publicId: String, override val systemId: String
7373
def label: String = "#PI"
7474

7575
/** always empty */
76-
def attribute: MetaData = Node.NoAttributes
76+
def attribute: ScalaVersionSpecificReturnTypes.ExternalIDAttribute = Node.NoAttributes
7777

7878
/** always empty */
7979
def child: Nil.type = Nil
@@ -85,8 +85,8 @@ case class PublicID(override val publicId: String, override val systemId: String
8585
* @author Michael Bayne
8686
*/
8787
object NoExternalID extends ExternalID {
88-
override val publicId /* TODO type annotation */ = null
89-
override val systemId /* TODO type annotation */ = null
88+
override val publicId: ScalaVersionSpecificReturnTypes.NoExternalIDId = null
89+
override val systemId: ScalaVersionSpecificReturnTypes.NoExternalIDId = null
9090

9191
override def toString: String = ""
9292
}

‎shared/src/main/scala/scala/xml/parsing/MarkupParserCommon.scala

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import Utility.SU
2222
* between the library level XML parser and the compiler's.
2323
* All members should be accessed through those.
2424
*/
25+
// Note: this is no longer true; Scala compiler uses its own copy since at least 2013.
2526
private[scala] trait MarkupParserCommon extends TokenTests {
2627
protected def unreachable: Nothing = truncatedError("Cannot be reached.")
2728

0 commit comments

Comments
 (0)
Please sign in to comment.