Skip to content

Commit 659ab0b

Browse files
committed
Avoid NoMatchError in IDE
I observed a NoType when editing some code which caused ThisType#underlying to crash.
1 parent 0af475c commit 659ab0b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -2184,7 +2184,7 @@ object Types {
21842184
if (ctx.erasedTypes) tref
21852185
else cls.info match {
21862186
case cinfo: ClassInfo => cinfo.selfType
2187-
case cinfo: ErrorType if ctx.mode.is(Mode.Interactive) => cinfo
2187+
case _: ErrorType | NoType if ctx.mode.is(Mode.Interactive) => cls.info
21882188
// can happen in IDE if `cls` is stale
21892189
}
21902190

0 commit comments

Comments
 (0)