File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed
compiler/src/dotty/tools/dotc/transform
tests/generic-java-signatures Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,8 @@ object GenericSignatures {
3333 * @return The signature if it could be generated, `None` otherwise.
3434 */
3535 def javaSig (sym0 : Symbol , info : Type )(using Context ): Option [String ] =
36- // Avoid generating a signature for local symbols.
37- if (sym0.isLocal) None
36+ // Avoid generating a signature for non-class local symbols.
37+ if (sym0.isLocal && ! sym0.isClass ) None
3838 else atPhase(erasurePhase)(javaSig0(sym0, info))
3939
4040 @ noinline
Original file line number Diff line number Diff line change 1+ Foo<java.lang.String>
2+ Foo<java.lang.String>
Original file line number Diff line number Diff line change 1+ class Foo [T ]
2+ object Test {
3+ class Inner extends Foo [String ]
4+
5+ def main (args : Array [String ]): Unit = {
6+ class Local extends Foo [String ]
7+
8+ println((new Inner ).getClass.getGenericSuperclass) // Foo<java.lang.String>
9+
10+ println((new Local ).getClass.getGenericSuperclass) // Foo<java.lang.String>
11+ }
12+ }
You can’t perform that action at this time.
0 commit comments