Skip to content

Harden IDE some more #2787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions compiler/src/dotty/tools/dotc/ast/Trees.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
4 changes: 3 additions & 1 deletion compiler/src/dotty/tools/dotc/core/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down