aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2017-03-29 22:00:49 +0200
committerMartin Odersky <odersky@gmail.com>2017-04-11 09:33:11 +0200
commitae694957bfb9f5121eee3434243ecaabb6b24d1d (patch)
tree53e233273c74ba4a5e1d9c5cede3c367e5b2b9d3
parentb595a98a5b51f3b328f1d69e6afc56f19129666d (diff)
downloaddotty-ae694957bfb9f5121eee3434243ecaabb6b24d1d.tar.gz
dotty-ae694957bfb9f5121eee3434243ecaabb6b24d1d.tar.bz2
dotty-ae694957bfb9f5121eee3434243ecaabb6b24d1d.zip
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.
-rw-r--r--compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala3
1 files changed, 2 insertions, 1 deletions
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 = {