diff --git a/compiler/src/dotty/tools/dotc/tastyreflect/TastyImpl.scala b/compiler/src/dotty/tools/dotc/tastyreflect/TastyImpl.scala index c4a6d69466cc..9124bd99c9c2 100644 --- a/compiler/src/dotty/tools/dotc/tastyreflect/TastyImpl.scala +++ b/compiler/src/dotty/tools/dotc/tastyreflect/TastyImpl.scala @@ -571,6 +571,7 @@ class TastyImpl(val rootContext: Contexts.Context) extends scala.tasty.Tasty { s def unapply(x: Pattern)(implicit ctx: Context): Option[Term] = x match { case lit: tpd.Literal @unchecked => Some(lit) case ref: tpd.RefTree @unchecked if ref.isTerm => Some(ref) + case ths: tpd.This @unchecked => Some(ths) case _ => None } } diff --git a/library/src/scala/tasty/util/ShowExtractors.scala b/library/src/scala/tasty/util/ShowExtractors.scala index 9a2d0aa84431..f458b0d73c62 100644 --- a/library/src/scala/tasty/util/ShowExtractors.scala +++ b/library/src/scala/tasty/util/ShowExtractors.scala @@ -190,6 +190,8 @@ class ShowExtractors[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty this += "Type.ParamRef(" += binder+= ", " += idx += ")" case Type.ThisType(tp) => this += "Type.ThisType(" += tp += ")" + case Type.SuperType(thistpe, supertpe) => + this += "Type.SuperType(" += thistpe += ", " += supertpe += ")" case Type.RecursiveThis(binder) => this += "Type.RecursiveThis(" += binder += ")" case Type.RecursiveType(underlying) => diff --git a/library/src/scala/tasty/util/ShowSourceCode.scala b/library/src/scala/tasty/util/ShowSourceCode.scala index e8abb6a361a9..7d3d7bd479a4 100644 --- a/library/src/scala/tasty/util/ShowSourceCode.scala +++ b/library/src/scala/tasty/util/ShowSourceCode.scala @@ -908,6 +908,10 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty printType(tp) } + case Type.SuperType(thistpe, supertpe) => + printType(supertpe) + this += ".super" + case Type.TypeLambda(paramNames, tparams, body) => inSquare(printMethodicTypeParams(paramNames, tparams)) this += " => "