Skip to content

Commit

Permalink
Merge pull request #636 from dwijnand/name-mangling
Browse files Browse the repository at this point in the history
Fix name mangling for nested classes
  • Loading branch information
dwijnand authored May 20, 2021
2 parents da0c4c2 + a516715 commit 9184e91
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ object MimaUnpickler {
def withOwner(cls: ClassInfo) = {
val nme1 = cls.bytecodeName
val nme2 = symbolInfo.name
val nme3 = if (nme2.startsWith(nme1)) nme2.substring(nme2.lastIndexOf('$') + 1) else nme2
val conc = if (nme1.endsWith("$")) "" else "$"
val suff = if (symbolInfo.isModuleOrModuleClass) "$" else ""
val name = nme1 + conc + nme2 + suff
val name = nme1 + conc + nme3 + suff
clazz.owner.classes(name)
}
val fallback = if (symbolInfo.isModuleOrModuleClass) clazz.moduleClass else clazz
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
object App {
def main(args: Array[String]): Unit = ()
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Foo {
private[Foo] object Bar
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Foo {
private[Foo] object Bar
}

0 comments on commit 9184e91

Please sign in to comment.