Skip to content

Commit 7381e9d

Browse files
authored
Merge pull request #2787 from dotty-staging/change-harden-ide
Harden IDE some more
2 parents 1d05796 + f43af9d commit 7381e9d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

compiler/src/dotty/tools/dotc/ast/Trees.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,8 +1305,10 @@ object Trees {
13051305
this(this(x, arg), annot)
13061306
case Thicket(ts) =>
13071307
this(x, ts)
1308-
case _ if ctx.reporter.errorsReported =>
1309-
// in case of errors it may be that typed trees point to untyped ones.
1308+
case _ if ctx.mode.is(Mode.Interactive) =>
1309+
// In case of errors it may be that typed trees point to untyped ones.
1310+
// The IDE can still traverse inside such trees, either in the run where errors
1311+
// are reported, or in subsequent ones.
13101312
x
13111313
}
13121314
}

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1538,7 +1538,9 @@ object Types {
15381538
else recomputeMember(d) // symbol could have been overridden, recompute membership
15391539
else {
15401540
val newd = loadDenot
1541-
if (newd.exists) newd else d.staleSymbolError
1541+
if (newd.exists) newd
1542+
else if (ctx.mode.is(Mode.Interactive)) d
1543+
else d.staleSymbolError
15421544
}
15431545
case d =>
15441546
if (d.validFor.runId != ctx.period.runId) loadDenot

0 commit comments

Comments
 (0)