Skip to content

Exclude <empty> package from class name #5724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 16, 2019
Merged
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
6 changes: 5 additions & 1 deletion compiler/src/dotty/tools/dotc/fromtasty/TastyFileUtil.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import dotty.tools.dotc.core.NameKinds
import dotty.tools.dotc.core.Names.SimpleName
import dotty.tools.dotc.core.StdNames.nme
import dotty.tools.dotc.core.tasty.{TastyUnpickler, TreePickler}
import dotty.tools.dotc.core.StdNames.nme.EMPTY_PACKAGE

object TastyFileUtil {

Expand All @@ -27,7 +28,10 @@ object TastyFileUtil {
val bytes = Files.readAllBytes(path)
val names = new core.tasty.TastyClassName(bytes).readName()
names.map { case (packageName, className) =>
val fullName = s"$packageName.${className.lastPart}"
val fullName = packageName match {
case EMPTY_PACKAGE => s"${className.lastPart}"
case _ => s"$packageName.${className.lastPart}"
}
val classInPath = fullName.replace(".", io.File.separator) + ".tasty"
val classpath = path.toString.replace(classInPath, "")
(classpath, fullName)
Expand Down