Skip to content

Commit c77f26e

Browse files
committed
Avoid NoMatchError in IDE
I observed a NoType when editing some code which caused ThisType#underlying to crash.
1 parent 2235f2a commit c77f26e

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
@@ -2195,7 +2195,7 @@ object Types {
21952195
if (ctx.erasedTypes) tref
21962196
else cls.info match {
21972197
case cinfo: ClassInfo => cinfo.selfType
2198-
case cinfo: ErrorType if ctx.mode.is(Mode.Interactive) => cinfo
2198+
case _: ErrorType | NoType if ctx.mode.is(Mode.Interactive) => cls.info
21992199
// can happen in IDE if `cls` is stale
22002200
}
22012201

0 commit comments

Comments
 (0)