From d71be28057621750f1ccb168f538c6d942935cac Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Tue, 29 Nov 2016 20:08:23 +0100 Subject: Fix some dotty compilation errors --- compiler/test/dotc/tests.scala | 2 +- compiler/test/dotty/partest/DPConsoleRunner.scala | 9 +++++++-- .../test/dotty/tools/dotc/parsing/ModifiersParsingTest.scala | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'compiler/test') diff --git a/compiler/test/dotc/tests.scala b/compiler/test/dotc/tests.scala index 608132bca..6ef6bb741 100644 --- a/compiler/test/dotc/tests.scala +++ b/compiler/test/dotc/tests.scala @@ -61,7 +61,7 @@ class tests extends CompilerTest { List("-classpath", paths) } - implicit val defaultOptions = noCheckOptions ++ { + implicit val defaultOptions: List[String] = noCheckOptions ++ { if (isRunByJenkins) List("-Ycheck:tailrec,resolveSuper,mixin,restoreScopes,labelDef") // should be Ycheck:all, but #725 else List("-Ycheck:tailrec,resolveSuper,mixin,restoreScopes,labelDef") } ++ checkOptions ++ classPath diff --git a/compiler/test/dotty/partest/DPConsoleRunner.scala b/compiler/test/dotty/partest/DPConsoleRunner.scala index f418d2c37..0ad573792 100644 --- a/compiler/test/dotty/partest/DPConsoleRunner.scala +++ b/compiler/test/dotty/partest/DPConsoleRunner.scala @@ -202,7 +202,7 @@ class DPTestRunner(testFile: File, suiteRunner: DPSuiteRunner) extends nest.Runn import FileManager.joinPaths // compile using command-line javac compiler val args = Seq( - javacCmdPath, + suiteRunner.javacCmdPath, // FIXME: Dotty deviation just writing "javacCmdPath" doesn't work "-d", outDir.getAbsolutePath, "-classpath", @@ -398,8 +398,13 @@ class DPTestRunner(testFile: File, suiteRunner: DPSuiteRunner) extends nest.Runn override def extraClasspath = suiteRunner.fileManager.asInstanceOf[DottyFileManager].extraJarList ::: super.extraClasspath + + // FIXME: Dotty deviation: error if return type is omitted: + // overriding method cleanup in class Runner of type ()Unit; + // method cleanup of type => Boolean | Unit has incompatible type + // override to keep class files if failed and delete clog if ok - override def cleanup = if (lastState.isOk) { + override def cleanup: Unit = if (lastState.isOk) { logFile.delete cLogFile.delete Directory(outDir).deleteRecursively diff --git a/compiler/test/dotty/tools/dotc/parsing/ModifiersParsingTest.scala b/compiler/test/dotty/tools/dotc/parsing/ModifiersParsingTest.scala index 32f842e92..806e1af46 100644 --- a/compiler/test/dotty/tools/dotc/parsing/ModifiersParsingTest.scala +++ b/compiler/test/dotty/tools/dotc/parsing/ModifiersParsingTest.scala @@ -10,11 +10,11 @@ import ast.untpd._ import ast.{ Trees => d } import Parsers.Parser import util.SourceFile -import core.Contexts.ContextBase +import core.Contexts._ import core.Flags object ModifiersParsingTest { - implicit val ctx = (new ContextBase).initialCtx + implicit val ctx: Context = (new ContextBase).initialCtx implicit def parse(code: String): Tree = { val (_, stats) = new Parser(new SourceFile("", code.toCharArray)).templateStatSeq() -- cgit v1.2.3