Skip to content

Commit

Permalink
Shorten ctx.typerState.reporter to ctx.reporter
Browse files Browse the repository at this point in the history
... making use of method in `ctx`.
  • Loading branch information
odersky committed Oct 26, 2015
1 parent 51ab200 commit 75ac401
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/dotty/tools/dotc/Driver.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ abstract class Driver extends DotClass {
catch {
case ex: FatalError =>
ctx.error(ex.getMessage) // signals that we should fail compilation.
ctx.typerState.reporter
ctx.reporter
}
else emptyReporter

Expand Down
2 changes: 1 addition & 1 deletion src/dotty/tools/dotc/Resident.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Resident extends Driver {
nextCtx = rootCtx
line = getLine()
}
if (line.startsWith(quit)) ctx.typerState.reporter
if (line.startsWith(quit)) ctx.reporter
else loop(line split "\\s+", nextCtx)
}
loop(args, rootCtx)
Expand Down
2 changes: 1 addition & 1 deletion src/dotty/tools/dotc/Run.scala
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class Run(comp: Compiler)(implicit ctx: Context) {
/** Print summary; return # of errors encountered */
def printSummary(): Reporter = {
ctx.runInfo.printMaxConstraint()
val r = ctx.typerState.reporter
val r = ctx.reporter
r.printSummary
r
}
Expand Down
2 changes: 1 addition & 1 deletion src/dotty/tools/dotc/transform/TreeChecker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class TreeChecker extends Phase with SymTransformer {
val squahsedPhase = ctx.squashed(prevPhase)
ctx.println(s"checking ${ctx.compilationUnit} after phase ${squahsedPhase}")
val checkingCtx = ctx.fresh
.setTyperState(ctx.typerState.withReporter(new ThrowingReporter(ctx.typerState.reporter)))
.setTyperState(ctx.typerState.withReporter(new ThrowingReporter(ctx.reporter)))
val checker = new Checker(previousPhases(phasesToRun.toList)(ctx))
try checker.typedExpr(ctx.compilationUnit.tpdTree)(checkingCtx)
catch {
Expand Down
2 changes: 1 addition & 1 deletion src/dotty/tools/dotc/typer/Applications.scala
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ trait Applications extends Compatibility { self: Typer =>

def ok = _ok
def ok_=(x: Boolean) = {
assert(x || ctx.errorsReported || !ctx.typerState.isCommittable) // !!! DEBUG
assert(x || ctx.reporter.errorsReported || !ctx.typerState.isCommittable) // !!! DEBUG
_ok = x
}

Expand Down
2 changes: 1 addition & 1 deletion src/dotty/tools/dotc/typer/Implicits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ trait Implicits { self: Typer =>
case _ => false
}
}
if (ctx.typerState.reporter.hasErrors)
if (ctx.reporter.hasErrors)
nonMatchingImplicit(ref)
else if (contextual && !ctx.mode.is(Mode.ImplicitShadowing) &&
!shadowing.tpe.isError && !refMatches(shadowing)) {
Expand Down

0 comments on commit 75ac401

Please sign in to comment.