We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c8030ef + f2b432e commit 7ba0d43Copy full SHA for 7ba0d43
compiler/src/dotty/tools/dotc/core/Types.scala
@@ -2177,7 +2177,11 @@ object Types {
2177
* do not survive runs whereas typerefs do.
2178
*/
2179
abstract case class ThisType(tref: TypeRef) extends CachedProxyType with SingletonType {
2180
- def cls(implicit ctx: Context): ClassSymbol = tref.stableInRunSymbol.asClass
+ def cls(implicit ctx: Context): ClassSymbol = tref.stableInRunSymbol match {
2181
+ case cls: ClassSymbol => cls
2182
+ case _ if ctx.mode.is(Mode.Interactive) => defn.AnyClass // was observed to happen in IDE mode
2183
+ }
2184
+
2185
override def underlying(implicit ctx: Context): Type =
2186
if (ctx.erasedTypes) tref
2187
else cls.info match {
0 commit comments