Skip to content

Commit ebbea1a

Browse files
committed
Better fix: Exclude in DottyBackendInterface
1 parent cd2b23a commit ebbea1a

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,10 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
535535

536536
private def getGenericSignature(sym: Symbol, owner: Symbol, memberTpe: Type)(implicit ctx: Context): Option[String] =
537537
if (needsGenericSignature(sym)) {
538-
val erasedTypeSym = sym.denot.info.typeSymbol
538+
val erasedTypeSym = TypeErasure.fullErasure(sym.denot.info).typeSymbol
539539
if (erasedTypeSym.isPrimitiveValueClass) {
540+
// Suppress signatures for symbols whose types erase in the end to primitive
541+
// value types. This is needed to fix #7416.
540542
None
541543
} else {
542544
val jsOpt = GenericSignatures.javaSig(sym, memberTpe)

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

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@ import core.Flags._
99
import core.Names.{DerivedName, Name, SimpleName, TypeName}
1010
import core.Symbols._
1111
import core.TypeApplications.TypeParamInfo
12-
import core.TypeErasure.{erasure, fullErasure}
12+
import core.TypeErasure.erasure
1313
import core.Types._
1414
import core.classfile.ClassfileConstants
1515
import ast.Trees._
1616
import SymUtils._
1717
import TypeUtils._
1818
import java.lang.StringBuilder
19-
import core.Decorators._
2019

2120
import scala.annotation.tailrec
2221

@@ -34,12 +33,7 @@ object GenericSignatures {
3433
*/
3534
def javaSig(sym0: Symbol, info: Type)(implicit ctx: Context): Option[String] =
3635
// Avoid generating a signature for local symbols.
37-
// Also suppress signatures for private symbols whose types erase in the end to primitive
38-
// value types. This is done to fix #7416. Since I do not know GenericSignatures well,
39-
// I did a minimal fix that lets #7416 pass. Maybe it can be generalized
40-
if sym0.isLocal
41-
|| sym0.is(Private) && fullErasure(info).isPrimitiveValueType
42-
then None
36+
if (sym0.isLocal) None
4337
else javaSig0(sym0, info)(ctx.withPhase(ctx.erasurePhase))
4438

4539
@noinline

0 commit comments

Comments
 (0)