Skip to content

Partially fix Java interop for emitted inner classes #1894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions tests/pos-java-interop/innerClass/Outer.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class Outer {
class InnerInClass

def inner() = new InnerInClass
}
object Outer {
class InnerInObject
}
9 changes: 9 additions & 0 deletions tests/pos-java-interop/innerClass/Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
public class Test {
public static void test() {
Outer outer = new Outer();
Outer.InnerInClass innerInClass = outer.inner();

// Does not work yet, requires https://github.com/DarkDimius/scala/pull/4
// Outer.InnerInObject innerInObject = new Outer.InnerInObject();
}
}