Skip to content

Commit aab7c7f

Browse files
committed
Do not print <empty> packages
1 parent fc35797 commit aab7c7f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,9 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
628628

629629
case Type.TermRef(name, prefix) =>
630630
prefix match {
631-
case prefix@Type() =>
631+
case Type.ThisType(Types.EmptyPackage()) =>
632+
this += name
633+
case prefix @ Type() =>
632634
printType(prefix)
633635
if (name != "package")
634636
this += "." += name
@@ -639,7 +641,7 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
639641

640642
case Type.TypeRef(name, prefix) =>
641643
prefix match {
642-
case NoPrefix() =>
644+
case NoPrefix() | Type.ThisType(Types.EmptyPackage()) =>
643645
case prefix@Type() =>
644646
printType(prefix)
645647
this += "."

0 commit comments

Comments
 (0)