Skip to content

Commit

Permalink
Avoid NoMatchError in IDE
Browse files Browse the repository at this point in the history
I observed a NoType when editing some code which caused ThisType#underlying to crash.
  • Loading branch information
odersky committed Mar 9, 2018
1 parent 0af475c commit 659ab0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2184,7 +2184,7 @@ object Types {
if (ctx.erasedTypes) tref
else cls.info match {
case cinfo: ClassInfo => cinfo.selfType
case cinfo: ErrorType if ctx.mode.is(Mode.Interactive) => cinfo
case _: ErrorType | NoType if ctx.mode.is(Mode.Interactive) => cls.info
// can happen in IDE if `cls` is stale
}

Expand Down

0 comments on commit 659ab0b

Please sign in to comment.