diff options
author | Martin Odersky <odersky@gmail.com> | 2015-05-04 13:02:49 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-05-04 13:02:57 +0200 |
commit | eb3c8e52dadb6244645adbc1443aed96dc24402e (patch) | |
tree | a78bb12eb98e548bc756d182d971161b0d60c9f6 /src/dotty/tools/dotc/Compiler.scala | |
parent | 4808d1ddf94ddfcab5e6b5dd9a8d2a3b003b89e0 (diff) | |
download | dotty-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.scala | 4 |
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 = { |