Skip to content

Commit 1138cac

Browse files
smarterodersky
authored andcommitted
Fix inner class name table emission with semantic names
The backend contains: val outerName = innerClassSym.rawowner.javaBinaryName // Java compatibility. See the big comment in BTypes that summarizes the InnerClass spec. val outerNameModule = if (innerClassSym.rawowner.isTopLevelModuleClass) outerName.dropModule Where `dropModule` is defined in the backend interface as: def dropModule: Name = n.stripModuleClassSuffix This will only work as expected if `javaBinaryName` returns a name with proper semantic information, but before this commit we just used the output of `fullNameSeparated` which contains no semantic information.
1 parent d088249 commit 1138cac

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,8 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
557557
def fullName: String = sym.showFullName
558558
def simpleName: Name = sym.name
559559
def javaSimpleName: Name = toDenot(sym).name // addModuleSuffix(simpleName.dropLocal)
560-
def javaBinaryName: Name = toDenot(sym).fullNameSeparated("/") // addModuleSuffix(fullNameInternal('/'))
560+
def javaBinaryName: Name = toDenot(sym).fullNameSeparated("/").unmangleClassName // addModuleSuffix(fullNameInternal('/'))
561+
// We use `unmangleClassName` so that `stripModuleClassSuffix` works as expected.
561562
def javaClassName: String = toDenot(sym).fullName.toString// addModuleSuffix(fullNameInternal('.')).toString
562563
def name: Name = sym.name
563564
def rawname: Name = {

0 commit comments

Comments
 (0)