Skip to content

Commit 86a383c

Browse files
Merge pull request #5724 from tuvior/empty-package-fix
Exclude <empty> package from class name
2 parents 4ecbb60 + b17359b commit 86a383c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

compiler/src/dotty/tools/dotc/fromtasty/TastyFileUtil.scala

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import dotty.tools.dotc.core.NameKinds
99
import dotty.tools.dotc.core.Names.SimpleName
1010
import dotty.tools.dotc.core.StdNames.nme
1111
import dotty.tools.dotc.core.tasty.{TastyUnpickler, TreePickler}
12+
import dotty.tools.dotc.core.StdNames.nme.EMPTY_PACKAGE
1213

1314
object TastyFileUtil {
1415

@@ -27,7 +28,10 @@ object TastyFileUtil {
2728
val bytes = Files.readAllBytes(path)
2829
val names = new core.tasty.TastyClassName(bytes).readName()
2930
names.map { case (packageName, className) =>
30-
val fullName = s"$packageName.${className.lastPart}"
31+
val fullName = packageName match {
32+
case EMPTY_PACKAGE => s"${className.lastPart}"
33+
case _ => s"$packageName.${className.lastPart}"
34+
}
3135
val classInPath = fullName.replace(".", io.File.separator) + ".tasty"
3236
val classpath = path.toString.replace(classInPath, "")
3337
(classpath, fullName)

0 commit comments

Comments
 (0)