Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion compiler/src/dotty/tools/dotc/core/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2177,7 +2177,11 @@ object Types {
* do not survive runs whereas typerefs do.
*/
abstract case class ThisType(tref: TypeRef) extends CachedProxyType with SingletonType {
def cls(implicit ctx: Context): ClassSymbol = tref.stableInRunSymbol.asClass
def cls(implicit ctx: Context): ClassSymbol = tref.stableInRunSymbol match {
case cls: ClassSymbol => cls
case _ if ctx.mode.is(Mode.Interactive) => defn.AnyClass // was observed to happen in IDE mode
}

override def underlying(implicit ctx: Context): Type =
if (ctx.erasedTypes) tref
else cls.info match {
Expand Down