Skip to content

Commit a9f3e95

Browse files
committed
Do not print <empty> packages
1 parent 82d4d0f commit a9f3e95

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

632632
case Type.TermRef(name, prefix) =>
633633
prefix match {
634-
case prefix@Type() =>
634+
case Type.ThisType(Types.EmptyPackage()) =>
635+
this += name
636+
case prefix @ Type() =>
635637
printType(prefix)
636638
if (name != "package")
637639
this += "." += name
@@ -642,7 +644,7 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
642644

643645
case Type.TypeRef(name, prefix) =>
644646
prefix match {
645-
case NoPrefix() =>
647+
case NoPrefix() | Type.ThisType(Types.EmptyPackage()) =>
646648
case prefix@Type() =>
647649
printType(prefix)
648650
this += "."

0 commit comments

Comments
 (0)