Closed
Description
How to reproduce:
In Line 26 of transform/CapturedVars.scala, change
private var Captured: Store.Location[collection.Set[Symbol]] = _
to
private[this] var Captured: Store.Location[collection.Set[Symbol]] = _
Compiling CapturedVars with -Xverify-signature gives
checking CapturedVars.scala after phase genSJSIR
-- Error: CapturedVars.scala:26:14 ---------------------------------------------
26 | private var Captured: Store.Location[collection.Set[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
Error while emitting CapturedVars.scala
exception occurred while compiling CapturedVars.scala
java.lang.IllegalArgumentException: I: 'T' expected at index 0 while compiling CapturedVars.scala
Exception in thread "main" java.lang.IllegalArgumentException: I: 'T' expected at index 0
at scala.tools.asm.util.CheckClassAdapter.checkChar(CheckClassAdapter.java:1018)
at scala.tools.asm.util.CheckClassAdapter.checkTypeVariableSignature(CheckClassAdapter.java:951)
at scala.tools.asm.util.CheckClassAdapter.checkFieldTypeSignature(CheckClassAdapter.java:859)
at scala.tools.asm.util.CheckClassAdapter.checkFieldSignature(CheckClassAdapter.java:714)
at dotty.tools.backend.jvm.DottyBackendInterface.verifySignature$$anonfun$1(DottyBackendInterface.scala:496)
at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at dotty.tools.backend.jvm.DottyBackendInterface.wrap$1(DottyBackendInterface.scala:480)
at dotty.tools.backend.jvm.DottyBackendInterface.verifySignature(DottyBackendInterface.scala:501)
It seems that the signature checker does not accept fields of primitive types (presumably, since a generic signature for such fields would be useless). In this case, the signature
comes from Store.Location
which is a value class wrapping an Int
.
If Captured
is just private
but not private[this]
, the signature is generated for the getter instead.
Metadata
Metadata
Assignees
Labels
No labels