Skip to content

Commit e47d90f

Browse files
committed
Do not generate signatures for local symbols
1 parent 05a9ad2 commit e47d90f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ object GenericSignatures {
2828
* @param info The type of the symbol
2929
* @return The signature if it could be generated, `None` otherwise.
3030
*/
31-
def javaSig(sym0: Symbol, info: Type)(implicit ctx: Context): Option[String] =
32-
javaSig0(sym0, info)(ctx.withPhase(ctx.erasurePhase))
31+
def javaSig(sym0: Symbol, info: Type)(implicit ctx: Context): Option[String] = {
32+
// Avoid generating a signature for local symbols.
33+
if (sym0.isLocal) None
34+
else javaSig0(sym0, info)(ctx.withPhase(ctx.erasurePhase))
35+
}
3336

3437
@noinline
3538
private final def javaSig0(sym0: Symbol, info: Type)(implicit ctx: Context): Option[String] = {
@@ -501,8 +504,7 @@ object GenericSignatures {
501504
case PolyType(_, _) =>
502505
true
503506
case ClassInfo(_, _, parents, _, _) =>
504-
// Local classes don't need a signature
505-
!tp.classSymbol.isLocal && foldOver(tp.typeParams.nonEmpty, parents)
507+
foldOver(tp.typeParams.nonEmpty, parents)
506508
case AnnotatedType(tpe, _) =>
507509
foldOver(x, tpe)
508510
case proxy: TypeProxy =>

0 commit comments

Comments
 (0)