Skip to content

Commit

Permalink
Fix new warnings in dotty-compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
felixmulder committed Aug 22, 2017
1 parent 9a9761d commit 1835fa2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/config/CompilerCommand.scala
Expand Up @@ -6,6 +6,7 @@ import Settings._
import core.Contexts._
import util.DotClass
import Properties._
import scala.collection.JavaConverters._

object CompilerCommand extends DotClass {

Expand Down Expand Up @@ -43,10 +44,9 @@ object CompilerCommand extends DotClass {
if (!Files.exists(path))
throw new java.io.FileNotFoundException("argument file %s could not be found" format path.getFileName)

import scala.collection.JavaConversions._
val lines = Files.readAllLines(path) // default to UTF-8 encoding

val params = lines map stripComment mkString " "
val params = lines.asScala map stripComment mkString " "
CommandLineParser.tokenize(params)
}

Expand Down
14 changes: 7 additions & 7 deletions compiler/src/dotty/tools/dotc/parsing/MarkupParsers.scala
Expand Up @@ -85,9 +85,9 @@ object MarkupParsers {

var xEmbeddedBlock = false

private var debugLastStartElement = new mutable.Stack[(Int, String)]
private def debugLastPos = debugLastStartElement.top._1
private def debugLastElem = debugLastStartElement.top._2
private var debugLastStartElement = List.empty[(Int, String)]
private def debugLastPos = debugLastStartElement.head._1
private def debugLastElem = debugLastStartElement.head._2

private def errorBraces() = {
reportSyntaxError("in XML content, please use '}}' to express '}'")
Expand Down Expand Up @@ -280,10 +280,10 @@ object MarkupParsers {
if (qname == "xml:unparsed")
return xUnparsed

debugLastStartElement.push((start, qname))
debugLastStartElement = (start, qname) :: debugLastStartElement
val ts = content
xEndTag(qname)
debugLastStartElement.pop()
debugLastStartElement = debugLastStartElement.tail
val pos = Position(start, curOffset, start)
qname match {
case "xml:group" => handle.group(pos, ts)
Expand Down Expand Up @@ -417,7 +417,7 @@ object MarkupParsers {
def xPattern: Tree = {
var start = curOffset
val qname = xName
debugLastStartElement.push((start, qname))
debugLastStartElement = (start, qname) :: debugLastStartElement
xSpaceOpt()

val ts = new ArrayBuffer[Tree]
Expand Down Expand Up @@ -457,7 +457,7 @@ object MarkupParsers {

while (doPattern) { } // call until false
xEndTag(qname)
debugLastStartElement.pop()
debugLastStartElement = debugLastStartElement.tail
}

handle.makeXMLpat(Position(start, curOffset, start), qname, ts)
Expand Down
10 changes: 5 additions & 5 deletions compiler/test/dotty/tools/vulpix/SummaryReport.scala
Expand Up @@ -59,7 +59,7 @@ final class NoSummaryReport extends SummaryReporting {
* which outputs to a log file in `./testlogs/`
*/
final class SummaryReport extends SummaryReporting {
import scala.collection.JavaConversions._
import scala.collection.JavaConverters._

private val startingMessages = new java.util.concurrent.ConcurrentLinkedDeque[String]
private val failedTests = new java.util.concurrent.ConcurrentLinkedDeque[String]
Expand Down Expand Up @@ -102,9 +102,9 @@ final class SummaryReport extends SummaryReporting {
|""".stripMargin
)

startingMessages.foreach(rep.append)
startingMessages.asScala.foreach(rep.append)

failedTests.map(x => s" $x\n").foreach(rep.append)
failedTests.asScala.map(x => s" $x\n").foreach(rep.append)

// If we're compiling locally, we don't need instructions on how to
// reproduce failures
Expand All @@ -121,15 +121,15 @@ final class SummaryReport extends SummaryReporting {

rep += '\n'

reproduceInstructions.foreach(rep.append)
reproduceInstructions.asScala.foreach(rep.append)

// If we're on the CI, we want everything
if (!isInteractive) println(rep.toString)

TestReporter.logPrintln(rep.toString)

// Perform cleanup callback:
if (cleanUps.nonEmpty) cleanUps.foreach(_.apply())
if (!cleanUps.isEmpty()) cleanUps.asScala.foreach(_.apply())
}

private def removeColors(msg: String): String =
Expand Down

0 comments on commit 1835fa2

Please sign in to comment.