From fa6054b874d1a9b6428d30f88a0346fc994c97de Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Wed, 23 Nov 2016 15:42:46 +0100 Subject: Make tests depend on environment variables for classpath jars sbt adds the correct jars to classpath and the tests depend on `packageAll` which creates these. When using something else however, these together with `sbt-interfaces` do not get propagated from the build. To remedy this and make the testing a bit more flexible, we now take these from `sys.props` instead, see `tests/dotty/Jars.scala`. If the props aren't defined we fall back to the ones default to sbt. --- compiler/test/dotc/tests.scala | 31 +++++++++++++++++----- compiler/test/dotty/Jars.scala | 22 +++++++++++++++ compiler/test/dotty/tools/DottyTest.scala | 5 +--- compiler/test/dotty/tools/ShowClassTests.scala | 6 ++--- .../test/dotty/tools/dotc/EntryPointsTest.scala | 7 ++--- .../dotty/tools/dotc/InterfaceEntryPointTest.scala | 7 ++--- compiler/test/dotty/tools/dotc/repl/TestREPL.scala | 8 +++--- 7 files changed, 61 insertions(+), 25 deletions(-) create mode 100644 compiler/test/dotty/Jars.scala diff --git a/compiler/test/dotc/tests.scala b/compiler/test/dotc/tests.scala index a3946947c..7d3dbd8db 100644 --- a/compiler/test/dotc/tests.scala +++ b/compiler/test/dotc/tests.scala @@ -1,5 +1,6 @@ package dotc +import dotty.Jars import dotty.tools.dotc.CompilerTest import org.junit.{Before, Test} @@ -32,18 +33,28 @@ class tests extends CompilerTest { ) val classPath = { - val paths = List( - "../library/target/scala-2.11/dotty-library_2.11-0.1-SNAPSHOT.jar", - "./target/scala-2.11/dotty-compiler_2.11-0.1-SNAPSHOT.jar", - "../interfaces/target/dotty-interfaces-0.1-SNAPSHOT.jar" - ).map { p => + val paths = Jars.dottyTestDeps map { p => val file = new JFile(p) assert( file.exists, - s"""File "$p" couldn't be found. Run `packageAll` from build tool before testing""" + s"""|File "$p" couldn't be found. Run `packageAll` from build tool before + |testing. + | + |If running without sbt, test paths need to be setup environment variables: + | + | - DOTTY_LIBRARY + | - DOTTY_COMPILER + | - DOTTY_INTERFACES + | - DOTTY_EXTRAS + | + |Where these all contain locations, except extras which is a comma + |separated list of jars. + | + |When compiling with eclipse, you need the sbt-interfaces jar, but + |it in extras.""" ) file.getAbsolutePath - }.mkString(":") + } mkString (":") List("-classpath", paths) } @@ -338,10 +349,16 @@ class tests extends CompilerTest { @Test def tasty_tests = compileDir(testsDir, "tasty", testPickling) @Test def tasty_bootstrap = { + val f = new JFile(getClass.getProtectionDomain.getCodeSource.getLocation.getPath) + println(f) + println(System.getProperty("java.class.path")) + + val opt = List("-priorityclasspath", defaultOutputDir, "-Ylog-classpath") // first compile dotty compileDir(dottyDir, ".", List("-deep", "-Ycheck-reentrant", "-strict"))(allowDeepSubtypes) + compileDir(dottyDir, "tools", opt) compileDir(toolsDir, "dotc", opt) compileDir(dotcDir, "ast", opt) diff --git a/compiler/test/dotty/Jars.scala b/compiler/test/dotty/Jars.scala new file mode 100644 index 000000000..989726bd4 --- /dev/null +++ b/compiler/test/dotty/Jars.scala @@ -0,0 +1,22 @@ +package dotty + +/** Jars used when compiling test, defaults to sbt locations */ +object Jars { + val dottyLib: String = sys.env.get("DOTTY_LIB") getOrElse { + "../library/target/scala-2.11/dotty-library_2.11-0.1-SNAPSHOT.jar" + } + + val dottyCompiler: String = sys.env.get("DOTTY_COMPILER") getOrElse { + "./target/scala-2.11/dotty-compiler_2.11-0.1-SNAPSHOT.jar" + } + + val dottyInterfaces: String = sys.env.get("DOTTY_INTERFACE") getOrElse { + "../interfaces/target/dotty-interfaces-0.1-SNAPSHOT.jar" + } + + val dottyExtras: List[String] = sys.env.get("DOTTY_EXTRAS") + .map(_.split(",").toList).getOrElse(Nil) + + val dottyTestDeps: List[String] = + dottyLib :: dottyCompiler :: dottyInterfaces :: dottyExtras +} diff --git a/compiler/test/dotty/tools/DottyTest.scala b/compiler/test/dotty/tools/DottyTest.scala index 77dc97bec..bd6b1cfa4 100644 --- a/compiler/test/dotty/tools/DottyTest.scala +++ b/compiler/test/dotty/tools/DottyTest.scala @@ -23,10 +23,7 @@ class DottyTest extends ContextEscapeDetection{ import base.settings._ val ctx = base.initialCtx.fresh ctx.setSetting(ctx.settings.encoding, "UTF8") - ctx.setSetting( - ctx.settings.classpath, - "../library/target/scala-2.11/dotty-library_2.11-0.1-SNAPSHOT.jar" - ) + ctx.setSetting(ctx.settings.classpath, Jars.dottyLib) // when classpath is changed in ctx, we need to re-initialize to get the // correct classpath from PathResolver base.initialize()(ctx) diff --git a/compiler/test/dotty/tools/ShowClassTests.scala b/compiler/test/dotty/tools/ShowClassTests.scala index 3c730b716..4aa9e8845 100644 --- a/compiler/test/dotty/tools/ShowClassTests.scala +++ b/compiler/test/dotty/tools/ShowClassTests.scala @@ -1,4 +1,5 @@ -package dotty.tools +package dotty +package tools import dotc.core._ import dotc.core.Contexts._ @@ -18,8 +19,7 @@ class ShowClassTests extends DottyTest { ctx.setSetting(ctx.settings.encoding, "UTF8") ctx.setSetting( ctx.settings.classpath, - "../library/target/scala-2.11/dotty-library_2.11-0.1-SNAPSHOT.jar" + - ":../interfaces/target/dotty-interfaces-0.1-SNAPSHOT.jar" + Jars.dottyLib + ":" + Jars.dottyInterfaces ) base.initialize()(ctx) ctx diff --git a/compiler/test/dotty/tools/dotc/EntryPointsTest.scala b/compiler/test/dotty/tools/dotc/EntryPointsTest.scala index 4a87bbcb5..f095dc725 100644 --- a/compiler/test/dotty/tools/dotc/EntryPointsTest.scala +++ b/compiler/test/dotty/tools/dotc/EntryPointsTest.scala @@ -1,4 +1,5 @@ -package dotty.tools +package dotty +package tools package dotc import org.junit.Test @@ -20,9 +21,9 @@ class EntryPointsTest { private val sources = List("../tests/pos/HelloWorld.scala").map(p => new java.io.File(p).getPath()) private val dottyInterfaces = - new java.io.File("../interfaces/dotty-interfaces-0.1-SNAPSHOT.jar").getPath + new java.io.File(Jars.dottyInterfaces).getPath private val dottyLibrary = - new java.io.File("../library/target/scala-2.11/dotty-library_2.11-0.1-SNAPSHOT.jar").getPath + new java.io.File(Jars.dottyLib).getPath private val args = sources ++ List("-d", "../out/") ++ diff --git a/compiler/test/dotty/tools/dotc/InterfaceEntryPointTest.scala b/compiler/test/dotty/tools/dotc/InterfaceEntryPointTest.scala index b36ea2955..7589e6f3b 100644 --- a/compiler/test/dotty/tools/dotc/InterfaceEntryPointTest.scala +++ b/compiler/test/dotty/tools/dotc/InterfaceEntryPointTest.scala @@ -1,4 +1,5 @@ -package dotty.tools.dotc +package dotty +package tools.dotc import org.junit.Test import org.junit.Assert._ @@ -21,9 +22,9 @@ class InterfaceEntryPointTest { val sources = List("../tests/pos/HelloWorld.scala").map(p => new java.io.File(p).getPath()) val dottyInterfaces = - new java.io.File("../interfaces/dotty-interfaces-0.1-SNAPSHOT.jar").getPath + new java.io.File(Jars.dottyInterfaces).getPath val dottyLibrary = - new java.io.File("../library/target/scala-2.11/dotty-library_2.11-0.1-SNAPSHOT.jar").getPath + new java.io.File(Jars.dottyLib).getPath val args = sources ++ diff --git a/compiler/test/dotty/tools/dotc/repl/TestREPL.scala b/compiler/test/dotty/tools/dotc/repl/TestREPL.scala index 2263e85a0..70f701791 100644 --- a/compiler/test/dotty/tools/dotc/repl/TestREPL.scala +++ b/compiler/test/dotty/tools/dotc/repl/TestREPL.scala @@ -1,4 +1,5 @@ -package dotty.tools.dotc +package dotty +package tools.dotc package repl import core.Contexts.Context @@ -23,10 +24,7 @@ class TestREPL(script: String) extends REPL { override def context(ctx: Context) = { val fresh = ctx.fresh fresh.setSetting(ctx.settings.color, "never") - fresh.setSetting( - ctx.settings.classpath, - "../library/target/scala-2.11/dotty-library_2.11-0.1-SNAPSHOT.jar" - ) + fresh.setSetting(ctx.settings.classpath, Jars.dottyLib) fresh.initialize()(fresh) fresh } -- cgit v1.2.3 From c429733272d9f8725e7769f63ebd9a86a403cd09 Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Wed, 23 Nov 2016 16:01:53 +0100 Subject: Update sequential tasks portion --- compiler/test/dotty/partest/DPConsoleRunner.scala | 33 ++++++++++++++--------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/compiler/test/dotty/partest/DPConsoleRunner.scala b/compiler/test/dotty/partest/DPConsoleRunner.scala index 363012683..1e0be75d8 100644 --- a/compiler/test/dotty/partest/DPConsoleRunner.scala +++ b/compiler/test/dotty/partest/DPConsoleRunner.scala @@ -88,27 +88,36 @@ extends SuiteRunner(testSourcePath, fileManager, updateCheck, failed, javaCmdPat """.stripMargin } - /** Tests which are compiled with one or more of the flags in this list will be run - * one by one, without any other test running at the same time. - * This is necessary because some test flags require a lot of memory when running - * the compiler and may exhaust the available memory when run in parallel with other tests. - */ - def sequentialFlags = List("-Ytest-pickler") + /** Some tests require a limitation of resources, tests which are compiled + * with one or more of the flags in this list will be run with + * `limitedThreads`. This is necessary because some test flags require a lot + * of memory when running the compiler and may exhaust the available memory + * when run in parallel with too many other tests. + * + * This number could be increased on the CI, but might fail locally if + * scaled too extreme - override with: + * + * ``` + * -Ddotty.tests.limitedThreads=X + * ``` + */ + def limitResourceFlags = List("-Ytest-pickler") + private val limitedThreads = sys.props.get("dotty.tests.limitedThreads").getOrElse("2") override def runTestsForFiles(kindFiles: Array[File], kind: String): Array[TestState] = { - val (sequentialTests, parallelTests) = + val (limitResourceTests, parallelTests) = kindFiles partition { kindFile => val flags = kindFile.changeExtension("flags").fileContents - sequentialFlags.exists(seqFlag => flags.contains(seqFlag)) + limitResourceFlags.exists(seqFlag => flags.contains(seqFlag)) } val seqResults = - if (!sequentialTests.isEmpty) { + if (!limitResourceTests.isEmpty) { val savedThreads = sys.props("partest.threads") - sys.props("partest.threads") = "2" + sys.props("partest.threads") = limitedThreads - NestUI.echo(s"## we will run ${sequentialTests.length} tests using ${PartestDefaults.numThreads} thread(s)") - val res = super.runTestsForFiles(sequentialTests, kind) + NestUI.echo(s"## we will run ${limitResourceTests.length} tests using ${PartestDefaults.numThreads} thread(s)") + val res = super.runTestsForFiles(limitResourceTests, kind) if (savedThreads != null) sys.props("partest.threads") = savedThreads -- cgit v1.2.3 From 6700dbd6b4e6d809891840201df16b7fd2eaf625 Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Wed, 23 Nov 2016 16:56:07 +0100 Subject: Make sure limitedThreads <= partest.threads --- compiler/test/dotty/partest/DPConsoleRunner.scala | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/compiler/test/dotty/partest/DPConsoleRunner.scala b/compiler/test/dotty/partest/DPConsoleRunner.scala index 1e0be75d8..f418d2c37 100644 --- a/compiler/test/dotty/partest/DPConsoleRunner.scala +++ b/compiler/test/dotty/partest/DPConsoleRunner.scala @@ -114,9 +114,16 @@ extends SuiteRunner(testSourcePath, fileManager, updateCheck, failed, javaCmdPat val seqResults = if (!limitResourceTests.isEmpty) { val savedThreads = sys.props("partest.threads") - sys.props("partest.threads") = limitedThreads + sys.props("partest.threads") = { + assert( + savedThreads == null || limitedThreads.toInt <= savedThreads.toInt, + """|Should not use more threads than the default, when the point + |is to limit the amount of resources""".stripMargin + ) + limitedThreads + } - NestUI.echo(s"## we will run ${limitResourceTests.length} tests using ${PartestDefaults.numThreads} thread(s)") + NestUI.echo(s"## we will run ${limitResourceTests.length} tests using ${PartestDefaults.numThreads} thread(s) in parallel") val res = super.runTestsForFiles(limitResourceTests, kind) if (savedThreads != null) @@ -392,13 +399,9 @@ class DPTestRunner(testFile: File, suiteRunner: DPSuiteRunner) extends nest.Runn suiteRunner.fileManager.asInstanceOf[DottyFileManager].extraJarList ::: super.extraClasspath // override to keep class files if failed and delete clog if ok - override def cleanup = if (lastState.isOk) try { + override def cleanup = if (lastState.isOk) { logFile.delete cLogFile.delete Directory(outDir).deleteRecursively - } catch { - case t: Throwable => - println("whhhhhhhhhhhhhhhhhhhhhhhhhhhaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaat") - throw t } } -- cgit v1.2.3 From ede2d531f0df401e7dd73e6c3d9c9fe5f4702d4b Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Wed, 23 Nov 2016 16:59:54 +0100 Subject: Get rid off custom classpath in entry point tests --- compiler/test/dotty/tools/dotc/EntryPointsTest.scala | 9 +-------- compiler/test/dotty/tools/dotc/InterfaceEntryPointTest.scala | 10 +--------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/compiler/test/dotty/tools/dotc/EntryPointsTest.scala b/compiler/test/dotty/tools/dotc/EntryPointsTest.scala index f095dc725..00918a282 100644 --- a/compiler/test/dotty/tools/dotc/EntryPointsTest.scala +++ b/compiler/test/dotty/tools/dotc/EntryPointsTest.scala @@ -20,14 +20,7 @@ import scala.collection.mutable.ListBuffer class EntryPointsTest { private val sources = List("../tests/pos/HelloWorld.scala").map(p => new java.io.File(p).getPath()) - private val dottyInterfaces = - new java.io.File(Jars.dottyInterfaces).getPath - private val dottyLibrary = - new java.io.File(Jars.dottyLib).getPath - private val args = - sources ++ - List("-d", "../out/") ++ - List("-classpath", dottyInterfaces + ":" + dottyLibrary) + private val args = sources ++ List("-d", "../out/", "-usejavacp") @Test def runCompiler = { val reporter = new CustomReporter diff --git a/compiler/test/dotty/tools/dotc/InterfaceEntryPointTest.scala b/compiler/test/dotty/tools/dotc/InterfaceEntryPointTest.scala index 7589e6f3b..e27b0f7b8 100644 --- a/compiler/test/dotty/tools/dotc/InterfaceEntryPointTest.scala +++ b/compiler/test/dotty/tools/dotc/InterfaceEntryPointTest.scala @@ -21,15 +21,7 @@ class InterfaceEntryPointTest { @Test def runCompilerFromInterface = { val sources = List("../tests/pos/HelloWorld.scala").map(p => new java.io.File(p).getPath()) - val dottyInterfaces = - new java.io.File(Jars.dottyInterfaces).getPath - val dottyLibrary = - new java.io.File(Jars.dottyLib).getPath - - val args = - sources ++ - List("-d", "../out/") ++ - List("-classpath", dottyInterfaces + ":" + dottyLibrary) + val args = sources ++ List("-d", "../out/", "-usejavacp") val mainClass = Class.forName("dotty.tools.dotc.Main") val process = mainClass.getMethod("process", -- cgit v1.2.3 From 9c1cb55478c7ce5708a36b67b65d857d8f907bd3 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 23 Nov 2016 18:54:21 +0100 Subject: Honor -verbose in tests -verbose output was suppressed like all other non-error output in the tests. Now we don't filter output if -verbose is set. --- compiler/test/dotty/tools/dotc/CompilerTest.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/test/dotty/tools/dotc/CompilerTest.scala b/compiler/test/dotty/tools/dotc/CompilerTest.scala index fbec9003a..5192ec84c 100644 --- a/compiler/test/dotty/tools/dotc/CompilerTest.scala +++ b/compiler/test/dotty/tools/dotc/CompilerTest.scala @@ -264,13 +264,14 @@ abstract class CompilerTest { private def compileArgs(args: Array[String], expectedErrorsPerFile: List[ErrorsInFile]) (implicit defaultOptions: List[String]): Unit = { val allArgs = args ++ defaultOptions + val verbose = allArgs.contains("-verbose") //println(s"""all args: ${allArgs.mkString("\n")}""") val processor = if (allArgs.exists(_.startsWith("#"))) Bench else Main val storeReporter = new Reporter with UniqueMessagePositions with HideNonSensicalMessages { private val consoleReporter = new ConsoleReporter() private val innerStoreReporter = new StoreReporter(consoleReporter) def doReport(m: MessageContainer)(implicit ctx: Context): Unit = { - if (m.level == ERROR) { + if (m.level == ERROR || verbose) { innerStoreReporter.flush() consoleReporter.doReport(m) } -- cgit v1.2.3 From 0d507d721529c596594ee6fe2de9ba7b7696eb27 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 23 Nov 2016 18:55:14 +0100 Subject: make REPL tests look at DOTTY_EXTRA classpath entries --- compiler/test/dotty/Jars.scala | 4 +++- compiler/test/dotty/tools/dotc/repl/TestREPL.scala | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/test/dotty/Jars.scala b/compiler/test/dotty/Jars.scala index 989726bd4..42c707069 100644 --- a/compiler/test/dotty/Jars.scala +++ b/compiler/test/dotty/Jars.scala @@ -15,7 +15,9 @@ object Jars { } val dottyExtras: List[String] = sys.env.get("DOTTY_EXTRAS") - .map(_.split(",").toList).getOrElse(Nil) + .map(_.split(":").toList).getOrElse(Nil) + + val dottyReplDeps: List[String] = dottyLib :: dottyExtras val dottyTestDeps: List[String] = dottyLib :: dottyCompiler :: dottyInterfaces :: dottyExtras diff --git a/compiler/test/dotty/tools/dotc/repl/TestREPL.scala b/compiler/test/dotty/tools/dotc/repl/TestREPL.scala index 70f701791..a38abcbab 100644 --- a/compiler/test/dotty/tools/dotc/repl/TestREPL.scala +++ b/compiler/test/dotty/tools/dotc/repl/TestREPL.scala @@ -24,7 +24,7 @@ class TestREPL(script: String) extends REPL { override def context(ctx: Context) = { val fresh = ctx.fresh fresh.setSetting(ctx.settings.color, "never") - fresh.setSetting(ctx.settings.classpath, Jars.dottyLib) + fresh.setSetting(ctx.settings.classpath, Jars.dottyReplDeps.mkString(":")) fresh.initialize()(fresh) fresh } -- cgit v1.2.3 From a72ba85afe9950f573cbced60aa37154ae0040e2 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 23 Nov 2016 18:56:05 +0100 Subject: Compile dotty library when bootstrapping --- compiler/test/dotc/tests.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/test/dotc/tests.scala b/compiler/test/dotc/tests.scala index 7d3dbd8db..a485484c2 100644 --- a/compiler/test/dotc/tests.scala +++ b/compiler/test/dotc/tests.scala @@ -353,12 +353,12 @@ class tests extends CompilerTest { println(f) println(System.getProperty("java.class.path")) - val opt = List("-priorityclasspath", defaultOutputDir, "-Ylog-classpath") // first compile dotty compileDir(dottyDir, ".", List("-deep", "-Ycheck-reentrant", "-strict"))(allowDeepSubtypes) - + compileDir(libDir, "dotty", "-deep" :: opt) + compileDir(libDir, "scala", "-deep" :: opt) compileDir(dottyDir, "tools", opt) compileDir(toolsDir, "dotc", opt) compileDir(dotcDir, "ast", opt) -- cgit v1.2.3 From 473230c638820b9c1d9cf40c218a5e9fc8caaa9f Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 23 Nov 2016 19:04:33 +0100 Subject: Revert fix to #1701. Fengyun's original solution was the right one. We cannot NOT enter a package class into its parent scope, because reloading the denotation with .member will fail. So we need to enter it and compensate by adding a clause to `qualifies` in `typedIdent`. Weirdly, this was noted only when running tasty_bootstrap from a custom classpath in the new build setup. So it was pretty tricky to diagnose. --- compiler/src/dotty/tools/dotc/core/Symbols.scala | 2 +- compiler/src/dotty/tools/dotc/typer/Typer.scala | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/core/Symbols.scala b/compiler/src/dotty/tools/dotc/core/Symbols.scala index c0427e320..cfd85c49c 100644 --- a/compiler/src/dotty/tools/dotc/core/Symbols.scala +++ b/compiler/src/dotty/tools/dotc/core/Symbols.scala @@ -428,7 +428,7 @@ object Symbols { final def entered(implicit ctx: Context): this.type = { assert(this.owner.isClass, s"symbol ($this) entered the scope of non-class owner ${this.owner}") // !!! DEBUG this.owner.asClass.enter(this) - if (this.is(Module, butNot = Package)) this.owner.asClass.enter(this.moduleClass) + if (this is Module) this.owner.asClass.enter(this.moduleClass) this } diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index 64936e106..9f5a942d6 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -120,15 +120,20 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit } else false - /** A symbol qualifies if it really exists. In addition, - * if we are in a constructor of a pattern, we ignore all definitions + /** A symbol qualifies if it really exists and is not a package class. + * In addition, if we are in a constructor of a pattern, we ignore all definitions * which are methods and not accessors (note: if we don't do that * case x :: xs in class List would return the :: method). + * + * Package classes are part of their parent's scope, because otherwise + * we could not reload them via `_.member`. On the other hand, accessing a + * package as a type from source is always an error. */ def qualifies(denot: Denotation): Boolean = - reallyExists(denot) && !( - pt.isInstanceOf[UnapplySelectionProto] && - (denot.symbol is (Method, butNot = Accessor))) + reallyExists(denot) && + !(pt.isInstanceOf[UnapplySelectionProto] && + (denot.symbol is (Method, butNot = Accessor))) && + !(denot.symbol is PackageClass) /** Find the denotation of enclosing `name` in given context `ctx`. * @param previous A denotation that was found in a more deeply nested scope, -- cgit v1.2.3 From 2f1a7946c01f3f08d4354465e6890c4214faf328 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 23 Nov 2016 19:04:55 +0100 Subject: More info when unpickling fails --- compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala | 4 ++-- compiler/test/dotc/tests.scala | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala index 66cfcf453..51f08a295 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala @@ -555,8 +555,8 @@ class TreeUnpickler(reader: TastyReader, tastyName: TastyName.Table, posUnpickle val tp = readType() val lazyAnnotTree = readLater(end, rdr => ctx => rdr.readTerm()(ctx)) annots += Annotation.deferredSymAndTree(tp.typeSymbol, _ => lazyAnnotTree.complete) - case _ => - assert(false, s"illegal modifier tag at $currentAddr") + case tag => + assert(false, s"illegal modifier tag $tag at $currentAddr, end = $end") } } (flags, annots.toList, privateWithin) diff --git a/compiler/test/dotc/tests.scala b/compiler/test/dotc/tests.scala index a485484c2..827e1addd 100644 --- a/compiler/test/dotc/tests.scala +++ b/compiler/test/dotc/tests.scala @@ -47,10 +47,10 @@ class tests extends CompilerTest { | - DOTTY_INTERFACES | - DOTTY_EXTRAS | - |Where these all contain locations, except extras which is a comma + |Where these all contain locations, except extras which is a colon |separated list of jars. | - |When compiling with eclipse, you need the sbt-interfaces jar, but + |When compiling with eclipse, you need the sbt-interfaces jar, put |it in extras.""" ) file.getAbsolutePath @@ -349,10 +349,6 @@ class tests extends CompilerTest { @Test def tasty_tests = compileDir(testsDir, "tasty", testPickling) @Test def tasty_bootstrap = { - val f = new JFile(getClass.getProtectionDomain.getCodeSource.getLocation.getPath) - println(f) - println(System.getProperty("java.class.path")) - val opt = List("-priorityclasspath", defaultOutputDir, "-Ylog-classpath") // first compile dotty compileDir(dottyDir, ".", List("-deep", "-Ycheck-reentrant", "-strict"))(allowDeepSubtypes) -- cgit v1.2.3