Skip to content

Commit c4fe39d

Browse files
committed
Revert "Drop no-longer-necessary guard to javaSig"
This reverts commit 5cdb001. Breaks in CI, here's a snippet: [info] Test dotty.tools.dotc.BootstrappedOnlyCompilationTests.posWithCompiler started -- Error: compiler/src/dotty/tools/dotc/transform/CapturedVars.scala:31:20 --------------------------------------------- 31 | private[this] var Captured: Store.Location[util.ReadOnlySet[Symbol]] = _ | ^ |compiler bug: created invalid generic signature for variable Captured in dotty.tools.dotc.transform.CapturedVars |signature: I |if this is reproducible, please report bug at https://github.com/lampepfl/dotty/issues |
1 parent 5cdb001 commit c4fe39d

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -847,12 +847,19 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
847847

848848
private def getGenericSignatureHelper(sym: Symbol, owner: Symbol, memberTpe: Type)(using Context): Option[String] = {
849849
if (needsGenericSignature(sym)) {
850-
val jsOpt = GenericSignatures.javaSig(sym, memberTpe)
851-
if (ctx.settings.XverifySignatures.value) {
852-
jsOpt.foreach(verifySignature(sym, _))
853-
}
850+
val erasedTypeSym = TypeErasure.fullErasure(sym.denot.info).typeSymbol
851+
if (erasedTypeSym.isPrimitiveValueClass) {
852+
// Suppress signatures for symbols whose types erase in the end to primitive
853+
// value types. This is needed to fix #7416.
854+
None
855+
} else {
856+
val jsOpt = GenericSignatures.javaSig(sym, memberTpe)
857+
if (ctx.settings.XverifySignatures.value) {
858+
jsOpt.foreach(verifySignature(sym, _))
859+
}
854860

855-
jsOpt
861+
jsOpt
862+
}
856863
} else {
857864
None
858865
}

0 commit comments

Comments
 (0)