Skip to content

Commit d85f1f2

Browse files
committed
Add missing SuperType in pattern match
1 parent 89ab499 commit d85f1f2

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

compiler/src/dotty/tools/dotc/tastyreflect/TastyImpl.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ class TastyImpl(val rootContext: Contexts.Context) extends scala.tasty.Tasty { s
571571
def unapply(x: Pattern)(implicit ctx: Context): Option[Term] = x match {
572572
case lit: tpd.Literal @unchecked => Some(lit)
573573
case ref: tpd.RefTree @unchecked if ref.isTerm => Some(ref)
574+
case ths: tpd.This @unchecked => Some(ths)
574575
case _ => None
575576
}
576577
}

library/src/scala/tasty/util/ShowExtractors.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ class ShowExtractors[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
190190
this += "Type.ParamRef(" += binder+= ", " += idx += ")"
191191
case Type.ThisType(tp) =>
192192
this += "Type.ThisType(" += tp += ")"
193+
case Type.SuperType(thistpe, supertpe) =>
194+
this += "Type.SuperType(" += thistpe += ", " += supertpe += ")"
193195
case Type.RecursiveThis(binder) =>
194196
this += "Type.RecursiveThis(" += binder += ")"
195197
case Type.RecursiveType(underlying) =>

library/src/scala/tasty/util/ShowSourceCode.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,10 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
908908
printType(tp)
909909
}
910910

911+
case Type.SuperType(thistpe, supertpe) =>
912+
printType(supertpe)
913+
this += ".super"
914+
911915
case Type.TypeLambda(paramNames, tparams, body) =>
912916
inSquare(printMethodicTypeParams(paramNames, tparams))
913917
this += " => "

0 commit comments

Comments
 (0)