Skip to content

Conversation

@smarter
Copy link
Member

@smarter smarter commented Jan 10, 2017

Commit 3d66b0d contains the following change:

-          val outerNameModule = if (isTopLevelModuleClass(innerClassSym.rawowner)) outerName.dropModule
+          val outerNameModule = if (innerClassSym.isTopLevelModuleClass) outerName.dropModule

It looks like the .rawowner got accidentally dropped. The result is
that for the given code:

object Outer {
  class Inner
}

The ClassEntry for Inner has outer name "Outer$" instead of "Outer",
this prevents referencing "Outer.Inner" from Java code.

Commit 3d66b0d contains the following change:
-          val outerNameModule = if (isTopLevelModuleClass(innerClassSym.rawowner)) outerName.dropModule
+          val outerNameModule = if (innerClassSym.isTopLevelModuleClass) outerName.dropModule

It looks like the `.rawowner` got accidentally dropped. The result is
that for the given code:
object Outer {
  class Inner
}

The ClassEntry for Inner has outer name "Outer$" instead of "Outer",
this prevents referencing "Outer.Inner" from Java code.
smarter added a commit to dotty-staging/dotty that referenced this pull request Jan 10, 2017
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 but before this commit, we put the mangled name
after flatten there.

Fixing this allows Java code to reference dotty inner classes, except if
they're defined in objects which is still broken until
lampepfl/scala#4 is merged and a new backend
is published.
smarter added a commit to dotty-staging/dotty that referenced this pull request Jan 10, 2017
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 but before this commit, we put the mangled name
after flatten there.

Fixing this allows Java code to reference dotty inner classes, except if
they're defined in objects which is still broken until
lampepfl/scala#4 is merged and a new backend
is published.
smarter added a commit to dotty-staging/dotty that referenced this pull request Jan 11, 2017
It does not compile with dotty because of
scala#1894 and
lampepfl/scala#4
smarter added a commit to dotty-staging/dotty that referenced this pull request Jan 11, 2017
It does not compile with dotty because of
scala#1894 and
lampepfl/scala#4
smarter added a commit to dotty-staging/dotty that referenced this pull request Jan 11, 2017
It does not compile with dotty because of
scala#1894 and
lampepfl/scala#4
@DarkDimius
Copy link

LGTM

@DarkDimius DarkDimius merged commit 40bdc7b into lampepfl:sharing-backend Jan 11, 2017
smarter added a commit to dotty-staging/dotty that referenced this pull request Jan 11, 2017
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
lampepfl/scala#4 is merged and a new backend
is published.
smarter added a commit to dotty-staging/dotty that referenced this pull request Jan 27, 2017
The upgraded backend contains a single new PR:
lampepfl/scala#4 which fixes Java interop with
Dotty-emitted inner classes in objects.
smarter added a commit to dotty-staging/dotty that referenced this pull request Jan 27, 2017
The upgraded backend contains a single new PR:
lampepfl/scala#4 which fixes Java interop with
Dotty-emitted inner classes in objects.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants