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 2 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
4 changes: 3 additions & 1 deletion 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 =>
case _ if ctx.mode.is(Mode.Interactive) =>
// in case of errors it may be that typed trees point to untyped ones.
// The can still traverse inside such trees, either in the run where errors
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing word between "The" and "can"?

// are reported, or in subsequent ones.
x
}
}
Expand Down
3 changes: 2 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,8 @@ 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 || ctx.mode.is(Mode.Interactive)) newd
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this going to fail with a NoDenotation error later on? If you really want to return the old denotation this should be d, not newd

else d.staleSymbolError
}
case d =>
if (d.validFor.runId != ctx.period.runId) loadDenot
Expand Down