Skip to content

Commit 628a967

Browse files
committed
Adapt isPackageObject to semantic naming
Used a hardcoded string before, which caused test failures.
1 parent 1058278 commit 628a967

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

compiler/src/dotty/tools/dotc/core/StdNames.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ object StdNames {
135135
val OPS_PACKAGE: N = "<special-ops>"
136136
val OVERLOADED: N = "<overloaded>"
137137
val PACKAGE: N = "package"
138-
val PACKAGE_CLS: N = "package$"
139138
val ROOT: N = "<root>"
140139
val SPECIALIZED_SUFFIX: N = "$sp"
141140
val SUPER_PREFIX: N = "super$"

compiler/src/dotty/tools/dotc/core/SymDenotations.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,10 @@ object SymDenotations {
513513

514514
/** Is this symbol a package object or its module class? */
515515
def isPackageObject(implicit ctx: Context): Boolean = {
516-
val poName = if (isType) nme.PACKAGE_CLS else nme.PACKAGE
517-
(name.toTermName == poName) && (owner is Package) && (this is Module)
516+
val nameMatches =
517+
if (isType) name == tpnme.PACKAGE.moduleClassName
518+
else name == nme.PACKAGE
519+
nameMatches && (owner is Package) && (this is Module)
518520
}
519521

520522
/** Is this symbol an abstract type? */

0 commit comments

Comments
 (0)