Skip to content

Commit 8775dd1

Browse files
committed
Drop internalNameString and hava javaBinaryName return a string
Needs updated backend # Conflicts: # compiler/src/dotty/tools/dotc/core/Names.scala
1 parent fa13f8d commit 8775dd1

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -409,11 +409,10 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
409409
def newSet[K](): mutable.Set[K] = new mutable.HashSet[K]
410410
}
411411

412-
413-
414412
val MODULE_INSTANCE_FIELD: String = nme.MODULE_INSTANCE_FIELD.toString
415413

416-
def internalNameString(offset: Int, length: Int): String = new String(Names.chrs, offset, length)
414+
def dropModule(str: String) =
415+
if (!str.isEmpty && str.last == '$') str.take(str.length - 1) else str
417416

418417
def newTermName(prefix: String): Name = prefix.toTermName
419418

@@ -424,7 +423,6 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
424423
Flags.Bridge | Flags.VBridge | Flags.Private | Flags.Macro
425424
}.bits
426425

427-
428426
def isQualifierSafeToElide(qual: Tree): Boolean = tpd.isIdempotentExpr(qual)
429427
def desugarIdent(i: Ident): Option[tpd.Select] = {
430428
i.tpe match {
@@ -557,7 +555,7 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
557555
def fullName: String = sym.showFullName
558556
def simpleName: Name = sym.name
559557
def javaSimpleName: Name = toDenot(sym).name // addModuleSuffix(simpleName.dropLocal)
560-
def javaBinaryName: Name = javaClassName.replace('.', '/').toTypeName // TODO: can we make this a string? addModuleSuffix(fullNameInternal('/'))
558+
def javaBinaryName: String = javaClassName.replace('.', '/') // TODO: can we make this a string? addModuleSuffix(fullNameInternal('/'))
561559
def javaClassName: String = toDenot(sym).fullName.toString// addModuleSuffix(fullNameInternal('.')).toString
562560
def name: Name = sym.name
563561
def rawname: Name = {

0 commit comments

Comments
 (0)