Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions compiler/src/dotty/tools/dotc/tastyreflect/TastyImpl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have tests for this code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In #4645, but it will take some time to be merged.

case _ => None
}
}
Expand Down
2 changes: 2 additions & 0 deletions library/src/scala/tasty/util/ShowExtractors.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand Down
4 changes: 4 additions & 0 deletions library/src/scala/tasty/util/ShowSourceCode.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 += " => "
Expand Down