Skip to content

Commit 7ea74c0

Browse files
committed
Eliminate stopAfterParser flag for compileForErrors
It was set so that `typeChecks` would never try typechecking, but that is not backed by the docs.
1 parent 086d1a8 commit 7ea74c0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/typer/Inliner.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ object Inliner {
293293
private enum ErrorKind:
294294
case Parser, Typer
295295

296-
private def compileForErrors(tree: Tree, stopAfterParser: Boolean)(using Context): List[(ErrorKind, Error)] =
296+
private def compileForErrors(tree: Tree)(using Context): List[(ErrorKind, Error)] =
297297
assert(tree.symbol == defn.CompiletimeTesting_typeChecks || tree.symbol == defn.CompiletimeTesting_typeCheckErrors)
298298
def stripTyped(t: Tree): Tree = t match {
299299
case Typed(t2, _) => stripTyped(t2)
@@ -317,7 +317,7 @@ object Inliner {
317317

318318
val parseErrors = ctx2.reporter.allErrors.toList
319319
res ++= parseErrors.map(e => ErrorKind.Parser -> e)
320-
if !stopAfterParser || res.isEmpty then
320+
if res.isEmpty then
321321
ctx2.typer.typed(tree2)(using ctx2)
322322
val typerErrors = ctx2.reporter.allErrors.filterNot(parseErrors.contains)
323323
res ++= typerErrors.map(e => ErrorKind.Typer -> e)
@@ -346,12 +346,12 @@ object Inliner {
346346

347347
/** Expand call to scala.compiletime.testing.typeChecks */
348348
def typeChecks(tree: Tree)(using Context): Tree =
349-
val errors = compileForErrors(tree, true)
349+
val errors = compileForErrors(tree)
350350
Literal(Constant(errors.isEmpty)).withSpan(tree.span)
351351

352352
/** Expand call to scala.compiletime.testing.typeCheckErrors */
353353
def typeCheckErrors(tree: Tree)(using Context): Tree =
354-
val errors = compileForErrors(tree, false)
354+
val errors = compileForErrors(tree)
355355
packErrors(errors)
356356

357357
/** Expand call to scala.compiletime.codeOf */

0 commit comments

Comments
 (0)