Skip to content

Commit 15ff616

Browse files
committed
Polishing and better documentation of Names.scala
# Conflicts: # compiler/src/dotty/tools/dotc/core/Names.scala
1 parent 0d8e15c commit 15ff616

File tree

9 files changed

+181
-134
lines changed

9 files changed

+181
-134
lines changed

compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
634634
toDenot(sym)(shiftedContext).isStatic(shiftedContext)
635635
}
636636

637-
def isStaticConstructor: Boolean = (isStaticMember && isClassConstructor) || (sym.name eq core.Names.STATIC_CONSTRUCTOR)
637+
def isStaticConstructor: Boolean = (isStaticMember && isClassConstructor) || (sym.name eq nme.STATIC_CONSTRUCTOR)
638638

639639

640640
// navigation

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ object NameKinds {
254254
if (i > 0) {
255255
val index = name.drop(i).toString.toInt - 1
256256
var original = name.take(i - str.DEFAULT_GETTER.length).asTermName
257-
if (original == nme.DEFAULT_GETTER_INIT) original = Names.CONSTRUCTOR
257+
if (original == nme.DEFAULT_GETTER_INIT) original = nme.CONSTRUCTOR
258258
apply(original, index)
259259
}
260260
else name

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,10 @@ object NameOps {
100100
* it is also called from the backend.
101101
*/
102102
def stripModuleClassSuffix: N = likeSpaced {
103-
val semName =
104-
if (name.isSimple && name.endsWith("$")) name.unmangleClassName else name
103+
val semName = name.toTermName match {
104+
case name: SimpleTermName if name.endsWith("$") => name.unmangleClassName
105+
case _ => name
106+
}
105107
semName.exclude(ModuleClassName)
106108
}
107109

0 commit comments

Comments
 (0)