-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix naming of inherited classes in ExtractAPI
For an inherited class, ExtractAPI would form a (source) class name by calling `Symbol.className` on the inherited class. However, that created a name of a class as seen at declaration site and not at inheritance site. Let's consider an example: class A { class AA } class B extends A Before this change, ExtractAPI would create an API representation of `AA` twice: once seen from A, and then the second time seen from B as an inherited member. However, in both cases it would use `A.AA` as a name. This commit fixes naming so an inherited representation of `AA` has a name `B.AA`. This commit also clarifies how classes declared in package objects are named. If you have: package pkg1.pkg2 package object pkg3 { class Foo } then the fully qualified name of the class corresponding to `pkg3` package object is pkg1.pkg2.pkg3.package. The full name of the `Foo` class is pkg2.pkg2.pkg3.Foo.
- Loading branch information
1 parent
1a696ed
commit 459df6b
Showing
7 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
zinc/src/sbt-test/source-dependencies/package-object-nested-class/A.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package object abc { | ||
object BuildInfoKey { | ||
sealed trait Entry | ||
} | ||
class Foo | ||
} |
2 changes: 2 additions & 0 deletions
2
zinc/src/sbt-test/source-dependencies/package-object-nested-class/test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
> compile | ||
|