diff --git a/compiler/src/dotty/tools/dotc/ast/Trees.scala b/compiler/src/dotty/tools/dotc/ast/Trees.scala index f7df30b404c6..2d120eca16ce 100644 --- a/compiler/src/dotty/tools/dotc/ast/Trees.scala +++ b/compiler/src/dotty/tools/dotc/ast/Trees.scala @@ -1305,8 +1305,10 @@ object Trees { this(this(x, arg), annot) case Thicket(ts) => this(x, ts) - case _ if ctx.reporter.errorsReported => - // in case of errors it may be that typed trees point to untyped ones. + case _ if ctx.mode.is(Mode.Interactive) => + // In case of errors it may be that typed trees point to untyped ones. + // The IDE can still traverse inside such trees, either in the run where errors + // are reported, or in subsequent ones. x } } diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index f8fe33e3e33f..cc11bc4f0bd5 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -1538,7 +1538,9 @@ object Types { else recomputeMember(d) // symbol could have been overridden, recompute membership else { val newd = loadDenot - if (newd.exists) newd else d.staleSymbolError + if (newd.exists) newd + else if (ctx.mode.is(Mode.Interactive)) d + else d.staleSymbolError } case d => if (d.validFor.runId != ctx.period.runId) loadDenot