Skip to content

Commit 07b983f

Browse files
committed
Do not print <empty> packages
1 parent 6d67d26 commit 07b983f

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
@@ -629,7 +629,9 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
629629

630630
case Type.TermRef(name, prefix) =>
631631
prefix match {
632-
case prefix@Type() =>
632+
case Type.ThisType(Types.EmptyPackage()) =>
633+
this += name
634+
case prefix @ Type() =>
633635
printType(prefix)
634636
if (name != "package")
635637
this += "." += name
@@ -640,7 +642,7 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
640642

641643
case Type.TypeRef(name, prefix) =>
642644
prefix match {
643-
case NoPrefix() =>
645+
case NoPrefix() | Type.ThisType(Types.EmptyPackage()) =>
644646
case prefix@Type() =>
645647
printType(prefix)
646648
this += "."

0 commit comments

Comments
 (0)