From 50268a1847d58deeb65c3a762e0b99b2d99ccb67 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Tue, 10 Jan 2017 23:26:02 +0100 Subject: Partially fix Java interop for emitted inner classes The backend uses `rawname` to define the "inner name" of an InnerClass entry in a classfile, this should be the simple name of the class before any mangling takes place. Fixing this allows Java code to reference dotty inner classes, except if they're defined in objects which is still broken until https://github.com/DarkDimius/scala/pull/4 is merged and a new backend is published. --- compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala') diff --git a/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala b/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala index c17a32744..51fa15706 100644 --- a/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala +++ b/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala @@ -560,7 +560,10 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma def javaBinaryName: Name = toDenot(sym).fullNameSeparated("/") // addModuleSuffix(fullNameInternal('/')) def javaClassName: String = toDenot(sym).fullName.toString// addModuleSuffix(fullNameInternal('.')).toString def name: Name = sym.name - def rawname: Name = sym.name // todo ???? + def rawname: Name = { + val original = toDenot(sym).initial + sym.name(ctx.withPhase(original.validFor.phaseId)) + } // types def info: Type = toDenot(sym).info -- cgit v1.2.3