Skip to content

Update dotty 0.21.0-RC1 #381

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

Merged
merged 1 commit into from
Jan 8, 2020
Merged
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: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ workflows:
java_version: jdk8
scala_version: 2.13.1
- scala_job:
name: dotty-0.18
name: dotty-0.21
java_version: jdk8
scala_version: 0.20.0-RC1
scala_version: 0.21.0-RC1
- scala_job:
name: jdk11_2.12
java_version: jdk11
Expand All @@ -103,7 +103,7 @@ workflows:
- scala_job:
name: jdk11_dotty
java_version: jdk11
scala_version: 0.20.0-RC1
scala_version: 0.21.0-RC1
- scala_job:
name: jdk13_2.12
java_version: jdk13
Expand All @@ -115,7 +115,7 @@ workflows:
- scala_job:
name: jdk13_dotty
java_version: jdk13
scala_version: 0.20.0-RC1
scala_version: 0.21.0-RC1
- scala_job:
name: jdk14_2.12
java_version: jdk14
Expand All @@ -127,7 +127,7 @@ workflows:
- scala_job:
name: jdk14_dotty
java_version: jdk14
scala_version: 0.20.0-RC1
scala_version: 0.21.0-RC1
- scalajs_job:
name: sjs0.6_2.12
scala_version: 2.12.10
Expand Down
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import: scala/scala-dev:travis/default.yml
language: scala

scala:
- 0.20.0-RC1
- 0.21.0-RC1
- 2.12.10
- 2.13.1

Expand All @@ -18,9 +18,9 @@ env:

matrix:
exclude:
- scala: 0.20.0-RC1
- scala: 0.21.0-RC1
env: SCALAJS_VERSION=0.6.31 ADOPTOPENJDK=8
- scala: 0.20.0-RC1
- scala: 0.21.0-RC1
env: SCALAJS_VERSION=1.0.0-RC2 ADOPTOPENJDK=8

install:
Expand Down
4 changes: 2 additions & 2 deletions jvm/src/test/scala/scala/xml/XMLTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class XMLTestJVM {
Elem(null, "title", e, sc, Text("Foundations of Programming Languages"))))

assertEquals("<book><author>Peter Buneman</author><author>Dan Suciu</author><title>Data on ze web</title></book>",
(parsedxml2 \\ "book") { n: Node => (n \ "title") xml_== "Data on ze web" } toString)
(parsedxml2 \\ "book") { (n: Node) => (n \ "title") xml_== "Data on ze web" } toString)

assertTrue(
((NodeSeq.fromSeq(List(parsedxml2))) \\ "_") sameElements List(
Expand Down Expand Up @@ -408,7 +408,7 @@ class XMLTestJVM {

@UnitTest
def t5115 = {
def assertHonorsIterableContract(i: Iterable[_]) = assertEquals(i.size, i.iterator.size)
def assertHonorsIterableContract(i: Iterable[_]) = assertEquals(i.size.toLong, i.iterator.size.toLong)

assertHonorsIterableContract(<a/>.attributes)
assertHonorsIterableContract(<a x=""/>.attributes)
Expand Down
7 changes: 3 additions & 4 deletions shared/src/main/scala/scala/xml/dtd/ElementValidator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,11 @@ class ElementValidator() extends Function1[Node, Boolean] {
for (attr <- md) {
def attrStr = attr.value.toString
def find(Key: String): Option[AttrDecl] = {
adecls.zipWithIndex find {
adecls.zipWithIndex collectFirst {
case (a@AttrDecl(Key, _, _), j) =>
ok += j; return Some(a)
case _ => false
ok += j
a
}
None
Copy link
Member Author

@ashawley ashawley Dec 28, 2019

Choose a reason for hiding this comment

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

I believe this is equivalent, but I need to test it. Dotty was frustrated with the non-local return.

Copy link
Member Author

Choose a reason for hiding this comment

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

There are a few tests of this code, but it's also vestigal, see #388.

}

find(attr.key) match {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,10 @@ class XIncludeFilter extends XMLFilterImpl {
val reader = new InputStreamReader(in, encoding)
val c = new Array[Char](1024)
var charsRead: Int = 0 // bogus init value
do {
while ({ {
charsRead = reader.read(c, 0, 1024)
if (charsRead > 0) this.characters(c, 0, charsRead)
} while (charsRead != -1)
} ; charsRead != -1}) ()
} catch {
case e: UnsupportedEncodingException =>
throw new SAXException("Unsupported encoding: "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ private[scala] trait MarkupParserCommon extends TokenTests {

val buf = new StringBuilder

do buf append ch_returning_nextch
while (isNameChar(ch))
while ({ buf append ch_returning_nextch
; isNameChar(ch)}) ()

if (buf.last == ':') {
reportSyntaxError("name cannot end in ':'")
Expand Down
4 changes: 2 additions & 2 deletions shared/src/test/scala/scala/xml/AttributeTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AttributeTest {
appended = appended.next
len = len + 1
}
assertEquals("removal of duplicates for unprefixed attributes in append", 1, len)
assertEquals("removal of duplicates for unprefixed attributes in append", 1L, len.toLong)
}

@Test
Expand Down Expand Up @@ -151,7 +151,7 @@ class AttributeTest {
def attributePathTwoChildrenWithAttributes: Unit = {
val xml = <a><b bar="1" /><b bar="2" /></a>
val b = xml \ "b"
assertEquals(2, b.length)
assertEquals(2, b.length.toLong)
assertEquals(NodeSeq.fromSeq(Seq(<b bar="1"/>, <b bar="2"/>)), b)
val barFail = b \ "@bar"
val barList = b.map(_ \ "@bar")
Expand Down
2 changes: 1 addition & 1 deletion shared/src/test/scala/scala/xml/UtilityTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class UtilityTest {
'\u001F' -> "^_", // Unit separator
'\u007F' -> "^?" // Delete
).toMap.withDefault {
key: Char => key.toString
(key: Char) => key.toString
}

def issue73StartsWithAndEndsWithWSInFirst: Unit = {
Expand Down
6 changes: 3 additions & 3 deletions shared/src/test/scala/scala/xml/XMLSyntaxTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ class XMLSyntaxTest {
assertEquals(1.5, handle[Double](xb), 0.0)

val xc = <hello>{ 5 }</hello>
assertEquals(5, handle[Int](xc))
assertEquals(5, handle[Int](xc).toLong)

val xd = <hello>{ true }</hello>
assertEquals(true, handle[Boolean](xd))

val xe = <hello>{ 5:Short }</hello>
assertEquals((5:Short), handle[Short](xe))
assertEquals((5:Short).toLong, handle[Short](xe).toLong)

val xf = <hello>{ val x = 27; x }</hello>
assertEquals(27, handle[Int](xf))
assertEquals(27, handle[Int](xf).toLong)

val xg = <hello>{ List(1,2,3,4) }</hello>
assertEquals("<hello>1 2 3 4</hello>", xg.toString)
Expand Down
2 changes: 1 addition & 1 deletion shared/src/test/scala/scala/xml/XMLTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ Ours is the portal of hope, come as you are."

@UnitTest
def t5115 = {
def assertHonorsIterableContract(i: Iterable[_]) = assertEquals(i.size, i.iterator.size)
def assertHonorsIterableContract(i: Iterable[_]) = assertEquals(i.size.toLong, i.iterator.size.toLong)

assertHonorsIterableContract(<a/>.attributes)
assertHonorsIterableContract(<a x=""/>.attributes)
Expand Down