From ae694957bfb9f5121eee3434243ecaabb6b24d1d Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Wed, 29 Mar 2017 22:00:49 +0200 Subject: 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. --- compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala b/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala index 45bbca017..10288a4be 100644 --- a/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala +++ b/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala @@ -557,7 +557,8 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma def fullName: String = sym.showFullName def simpleName: Name = sym.name def javaSimpleName: Name = toDenot(sym).name // addModuleSuffix(simpleName.dropLocal) - def javaBinaryName: Name = toDenot(sym).fullNameSeparated("/") // addModuleSuffix(fullNameInternal('/')) + def javaBinaryName: Name = toDenot(sym).fullNameSeparated("/").unmangleClassName // addModuleSuffix(fullNameInternal('/')) + // We use `unmangleClassName` so that `stripModuleClassSuffix` works as expected. def javaClassName: String = toDenot(sym).fullName.toString// addModuleSuffix(fullNameInternal('.')).toString def name: Name = sym.name def rawname: Name = { -- cgit v1.2.3