Skip to content

Commit

Permalink
Revert "Drop no-longer-necessary guard to javaSig"
Browse files Browse the repository at this point in the history
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
       |
  • Loading branch information
dwijnand committed Dec 13, 2022
1 parent 5cdb001 commit be10979
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions compiler/src/dotty/tools/backend/jvm/BCodeHelpers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -847,12 +847,19 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {

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

jsOpt
jsOpt
}
} else {
None
}
Expand Down

0 comments on commit be10979

Please sign in to comment.