Skip to content

Commit e133e3f

Browse files
committed
Call TreeNodeChecker.traverse directly
Now that we're not running this on every `typed` invocation, the compilation unit tree isn't going to be a top-level TypeTree.
1 parent e6e4565 commit e133e3f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class TreeChecker extends Phase with SymTransformer {
130130
assert(ctx.typerState.constraint.domainLambdas.isEmpty,
131131
i"non-empty constraint at end of $fusedPhase: ${ctx.typerState.constraint}, ownedVars = ${ctx.typerState.ownedVars.toList}%, %")
132132
assertSelectWrapsNew(ctx.compilationUnit.tpdTree)
133-
TreeNodeChecker.run(ctx.compilationUnit.tpdTree)
133+
TreeNodeChecker.traverse(ctx.compilationUnit.tpdTree)
134134
}
135135

136136
val checkingCtx = ctx
@@ -651,7 +651,6 @@ object TreeChecker {
651651
/** Check that the tree only contains legal children trees */
652652
object TreeNodeChecker extends untpd.TreeTraverser:
653653
import untpd._
654-
def run(tree: Tree)(using Context) = if !tree.isInstanceOf[TypeTree] then traverse(tree)
655654
def traverse(tree: Tree)(using Context) = tree match
656655
case t: TypeTree => assert(assertion = false, t)
657656
case t @ TypeApply(fun, _targs) => traverse(fun)

0 commit comments

Comments
 (0)