We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a4a2d04 commit 13e2170Copy full SHA for 13e2170
compiler/src/dotty/tools/dotc/core/Types.scala
@@ -2112,7 +2112,12 @@ object Types {
2112
abstract case class ThisType(tref: TypeRef) extends CachedProxyType with SingletonType {
2113
def cls(implicit ctx: Context): ClassSymbol = tref.stableInRunSymbol.asClass
2114
override def underlying(implicit ctx: Context): Type =
2115
- if (ctx.erasedTypes) tref else cls.classInfo.selfType
+ if (ctx.erasedTypes) tref
2116
+ else cls.info match {
2117
+ case cinfo: ClassInfo => cinfo.selfType
2118
+ case cinfo: ErrorType if ctx.mode.is(Mode.Interactive) => cinfo
2119
+ // can happen in IDE if `cls` is stale
2120
+ }
2121
2122
override def computeHash = doHash(tref)
2123
0 commit comments