Skip to content

Commit 75ac401

Browse files
committed
Shorten ctx.typerState.reporter to ctx.reporter
... making use of method in `ctx`.
1 parent 51ab200 commit 75ac401

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

src/dotty/tools/dotc/Driver.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ abstract class Driver extends DotClass {
2424
catch {
2525
case ex: FatalError =>
2626
ctx.error(ex.getMessage) // signals that we should fail compilation.
27-
ctx.typerState.reporter
27+
ctx.reporter
2828
}
2929
else emptyReporter
3030

src/dotty/tools/dotc/Resident.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Resident extends Driver {
4747
nextCtx = rootCtx
4848
line = getLine()
4949
}
50-
if (line.startsWith(quit)) ctx.typerState.reporter
50+
if (line.startsWith(quit)) ctx.reporter
5151
else loop(line split "\\s+", nextCtx)
5252
}
5353
loop(args, rootCtx)

src/dotty/tools/dotc/Run.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class Run(comp: Compiler)(implicit ctx: Context) {
8484
/** Print summary; return # of errors encountered */
8585
def printSummary(): Reporter = {
8686
ctx.runInfo.printMaxConstraint()
87-
val r = ctx.typerState.reporter
87+
val r = ctx.reporter
8888
r.printSummary
8989
r
9090
}

src/dotty/tools/dotc/transform/TreeChecker.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class TreeChecker extends Phase with SymTransformer {
118118
val squahsedPhase = ctx.squashed(prevPhase)
119119
ctx.println(s"checking ${ctx.compilationUnit} after phase ${squahsedPhase}")
120120
val checkingCtx = ctx.fresh
121-
.setTyperState(ctx.typerState.withReporter(new ThrowingReporter(ctx.typerState.reporter)))
121+
.setTyperState(ctx.typerState.withReporter(new ThrowingReporter(ctx.reporter)))
122122
val checker = new Checker(previousPhases(phasesToRun.toList)(ctx))
123123
try checker.typedExpr(ctx.compilationUnit.tpdTree)(checkingCtx)
124124
catch {

src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ trait Applications extends Compatibility { self: Typer =>
153153

154154
def ok = _ok
155155
def ok_=(x: Boolean) = {
156-
assert(x || ctx.errorsReported || !ctx.typerState.isCommittable) // !!! DEBUG
156+
assert(x || ctx.reporter.errorsReported || !ctx.typerState.isCommittable) // !!! DEBUG
157157
_ok = x
158158
}
159159

src/dotty/tools/dotc/typer/Implicits.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ trait Implicits { self: Typer =>
495495
case _ => false
496496
}
497497
}
498-
if (ctx.typerState.reporter.hasErrors)
498+
if (ctx.reporter.hasErrors)
499499
nonMatchingImplicit(ref)
500500
else if (contextual && !ctx.mode.is(Mode.ImplicitShadowing) &&
501501
!shadowing.tpe.isError && !refMatches(shadowing)) {

0 commit comments

Comments
 (0)