diff options
author | vsalvis <salvisbergvera@gmail.com> | 2015-06-24 16:14:59 +0200 |
---|---|---|
committer | vsalvis <salvisbergvera@gmail.com> | 2015-06-24 16:14:59 +0200 |
commit | 919f5b2e5c5a091326a0693db49ac30ca1e6bf0f (patch) | |
tree | bdea3c75630cac92f08917bcdc4ea6584f8ce78e /src/dotty/tools/dotc/Compiler.scala | |
parent | 78fae1152a7b381af4639d3d66ed637eac3ca9d0 (diff) | |
download | dotty-919f5b2e5c5a091326a0693db49ac30ca1e6bf0f.tar.gz dotty-919f5b2e5c5a091326a0693db49ac30ca1e6bf0f.tar.bz2 dotty-919f5b2e5c5a091326a0693db49ac30ca1e6bf0f.zip |
Partest 1/3: Pass PrintWriter as argument for context creation
Diffstat (limited to 'src/dotty/tools/dotc/Compiler.scala')
-rw-r--r-- | src/dotty/tools/dotc/Compiler.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/Compiler.scala b/src/dotty/tools/dotc/Compiler.scala index 386f976cf..94be0342b 100644 --- a/src/dotty/tools/dotc/Compiler.scala +++ b/src/dotty/tools/dotc/Compiler.scala @@ -7,7 +7,7 @@ import Periods._ import Symbols._ import Scopes._ import typer.{FrontEnd, Typer, Mode, ImportInfo, RefChecks} -import reporting.ConsoleReporter +import reporting.{ConsoleReporter, Reporter} import Phases.Phase import dotty.tools.dotc.transform._ import dotty.tools.dotc.transform.TreeTransforms.{TreeTransform, TreeTransformer} @@ -93,7 +93,7 @@ class Compiler { * for type checking. * imports For each element of RootImports, an import context */ - def rootContext(implicit ctx: Context): Context = { + def rootContext(implicit ctx: Context, r: Option[Reporter] = None): Context = { ctx.definitions.init(ctx) ctx.setPhasePlan(phases) val rootScope = new MutableScope @@ -105,7 +105,7 @@ class Compiler { .setOwner(defn.RootClass) .setTyper(new Typer) .setMode(Mode.ImplicitsEnabled) - .setTyperState(new MutableTyperState(ctx.typerState, new ConsoleReporter()(ctx), isCommittable = true)) + .setTyperState(new MutableTyperState(ctx.typerState, r.getOrElse(new ConsoleReporter()(ctx)), isCommittable = true)) ctx.definitions.init(start) // set context of definitions to start def addImport(ctx: Context, symf: () => Symbol) = ctx.fresh.setImportInfo(ImportInfo.rootImport(symf)(ctx)) @@ -117,8 +117,8 @@ class Compiler { ctx.runInfo.clear() } - def newRun(implicit ctx: Context): Run = { + def newRun(implicit ctx: Context, r: Option[Reporter] = None): Run = { reset() - new Run(this)(rootContext) + new Run(this)(rootContext(ctx, r)) } } |