aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/Compiler.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-05-04 13:02:49 +0200
committerMartin Odersky <odersky@gmail.com>2015-05-04 13:02:57 +0200
commiteb3c8e52dadb6244645adbc1443aed96dc24402e (patch)
treea78bb12eb98e548bc756d182d971161b0d60c9f6 /src/dotty/tools/dotc/Compiler.scala
parent4808d1ddf94ddfcab5e6b5dd9a8d2a3b003b89e0 (diff)
downloaddotty-eb3c8e52dadb6244645adbc1443aed96dc24402e.tar.gz
dotty-eb3c8e52dadb6244645adbc1443aed96dc24402e.tar.bz2
dotty-eb3c8e52dadb6244645adbc1443aed96dc24402e.zip
Honor -Yno-imports flag
If the flag is set, no root imports are added.
Diffstat (limited to 'src/dotty/tools/dotc/Compiler.scala')
-rw-r--r--src/dotty/tools/dotc/Compiler.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/Compiler.scala b/src/dotty/tools/dotc/Compiler.scala
index 4142acfa4..93a4edd6f 100644
--- a/src/dotty/tools/dotc/Compiler.scala
+++ b/src/dotty/tools/dotc/Compiler.scala
@@ -103,9 +103,11 @@ class Compiler {
.setMode(Mode.ImplicitsEnabled)
.setTyperState(new MutableTyperState(ctx.typerState, new ConsoleReporter()(ctx), isCommittable = true))
ctx.definitions.init(start) // set context of definitions to start
+ start.setRunInfo(new RunInfo(start))
def addImport(ctx: Context, sym: Symbol) =
ctx.fresh.setImportInfo(ImportInfo.rootImport(sym)(ctx))
- (start.setRunInfo(new RunInfo(start)) /: defn.RootImports)(addImport)
+ if (ctx.settings.YnoImports.value) start
+ else (start /: defn.RootImports)(addImport)
}
def reset()(implicit ctx: Context): Unit = {