diff options
author | Martin Odersky <odersky@gmail.com> | 2015-05-05 15:25:24 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-05-05 15:25:24 +0200 |
commit | 2fdf660aba6a23a5adb665bd1af4d54e8952034c (patch) | |
tree | cfa7c73960c107f9f6b158f5ec19c8a7aee6ea88 /src/dotty/tools/dotc/Compiler.scala | |
parent | 7129cbe60c062be49aef8c27da461a11416e189c (diff) | |
download | dotty-2fdf660aba6a23a5adb665bd1af4d54e8952034c.tar.gz dotty-2fdf660aba6a23a5adb665bd1af4d54e8952034c.tar.bz2 dotty-2fdf660aba6a23a5adb665bd1af4d54e8952034c.zip |
Allow to compile root import classes without special option.
Can now compile Predef/DottyPredef without -Yno-import option.
Achieved by making some parts of imports more lazy.
Diffstat (limited to 'src/dotty/tools/dotc/Compiler.scala')
-rw-r--r-- | src/dotty/tools/dotc/Compiler.scala | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/Compiler.scala b/src/dotty/tools/dotc/Compiler.scala index d4837ae74..4899454a2 100644 --- a/src/dotty/tools/dotc/Compiler.scala +++ b/src/dotty/tools/dotc/Compiler.scala @@ -104,11 +104,9 @@ 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)) - if (ctx.settings.YnoImports.value) start - else (start /: defn.RootImports)(addImport) + def addImport(ctx: Context, symf: () => Symbol) = + ctx.fresh.setImportInfo(ImportInfo.rootImport(symf)(ctx)) + (start.setRunInfo(new RunInfo(start)) /: defn.RootImportFns)(addImport) } def reset()(implicit ctx: Context): Unit = { |