New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException is thrown when compiling pure trait impl with @varargs def #10059

Closed
scabug opened this Issue Nov 15, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@scabug
Copy link

scabug commented Nov 15, 2016

Following code compiles with 2.11.8, but with 2.12.0 in sbt 0.13.13 NullPointerException is thrown

trait VarargsTest {
  @varargs def apply(l: Double*): Double
}

object VarargsTest {

  object Impl extends VarargsTest {
    override final def apply(l: Double*): Double = throw new UnsupportedOperationException("dummy impl")
  }

}

exception thrown:

java.lang.NullPointerException
        at scala.tools.asm.tree.MethodNode.visitLocalVariable(MethodNode.java:572)
        at scala.tools.nsc.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.emitLocalVarScope(BCodeSkelBuilder.scala:719)
        at scala.tools.nsc.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.$anonfun$genDefDef$8(BCodeSkelBuilder.scala:629)
        at scala.tools.nsc.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.emitNormalMethodBody$1(BCodeSkelBuilder.scala:629)
        at scala.tools.nsc.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.genDefDef(BCodeSkelBuilder.scala:636)
        at scala.tools.nsc.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.gen(BCodeSkelBuilder.scala:507)
        at scala.tools.nsc.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.$anonfun$gen$7(BCodeSkelBuilder.scala:512)
        at scala.tools.nsc.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.gen(BCodeSkelBuilder.scala:512)
        at scala.tools.nsc.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.genPlainClass(BCodeSkelBuilder.scala:113)
        at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase$Worker1.visit(GenBCode.scala:190)
        at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase$Worker1.$anonfun$run$1(GenBCode.scala:139)
        at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase$Worker1.run(GenBCode.scala:139)
        at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase.buildAndSendToDisk(GenBCode.scala:381)
        at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase.run(GenBCode.scala:350)
        at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1404)
        at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1389)
        at scala.tools.nsc.Global$Run.compileSources(Global.scala:1384)
        at scala.tools.nsc.Global$Run.compile(Global.scala:1478)
        ...
@scabug

This comment has been minimized.

Copy link
Author

scabug commented Nov 15, 2016

Imported From: https://issues.scala-lang.org/browse/SI-10059?orig=1
Reporter: Kirill Plyashkevich (412b)
Affected Versions: 2.12.0

@scabug

This comment has been minimized.

Copy link
Author

scabug commented Nov 16, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment