Skip to content
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

NPE in mixin in scala-continuations #8318

Closed
scabug opened this issue Feb 20, 2014 · 6 comments
Closed

NPE in mixin in scala-continuations #8318

scabug opened this issue Feb 20, 2014 · 6 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Feb 20, 2014

% sbt -scala-version 2.11.0-SNAPSHOT
...
java.lang.NullPointerException
	at scala.tools.nsc.transform.Mixin$MixinTransformer.scala$tools$nsc$transform$Mixin$MixinTransformer$$postTransform(Mixin.scala:1132)
	at scala.tools.nsc.transform.Mixin$MixinTransformer$$anonfun$transform$1.apply(Mixin.scala:1239)
	at scala.tools.nsc.transform.Mixin$MixinTransformer$$anonfun$transform$1.apply(Mixin.scala:1239)
	at scala.reflect.internal.SymbolTable.enteringPhase(SymbolTable.scala:241)
	at scala.reflect.internal.SymbolTable.exitingPhase(SymbolTable.scala:262)
	at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:1239)
	at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:468)
	at scala.reflect.internal.Trees$class.itransform(Trees.scala:1340)
	at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
	at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:16)
	at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
	at scala.tools.nsc.transform.Mixin$MixinTransformer.transform(Mixin.scala:1236)
[error] (library/test:compile) java.lang.NullPointerException
[error] Total time: 92 s, completed Feb 20, 2014 11:36:10 AM
@scabug
Copy link
Author

scabug commented Feb 20, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8318?orig=1
Reporter: @retronym
Affected Versions: 2.11.0-M8

@scabug
Copy link
Author

scabug commented Feb 20, 2014

@retronym said:
/cc @gkossakowski

@scabug
Copy link
Author

scabug commented Feb 20, 2014

@retronym said:
Regressed in:

 commit b0fca1abe35d45b64ed6bbd2edd12f63e8999c5d
Author: Eugene Burmako <xeno.by@gmail.com>
Date:   Fri Feb 7 13:56:54 2014 +0100

    does away with resetAllAttrs in typedLabelDef

    Again, resetLocalAttrs works just fine there - no need
    references to externally defined symbols.

/cc Eugene.

@scabug
Copy link
Author

scabug commented Feb 20, 2014

@retronym said:
Minimal test:

package scala.tools.selectivecps

import scala.annotation._
import scala.util.continuations._
  
class While {
  def foo1(): Int @cps[Unit] = 2
  def foo2(): Int @cps[Unit] = shift { k => k(2) }

  def test2(): Unit @cps[Unit] = {
    var x = 0
    while (x < 9000) { // pick number large enough to require tail-call opt
      x = x + (if (x % 1000 != 0) foo1() else foo2())
    }
    ()
  }

  def while2 = {
    reset(test2())
  }
}

@scabug
Copy link
Author

scabug commented Feb 20, 2014

@retronym said:
@eugene: a bit of relevant history for typedLabelDef

scala/scala@65520ac
scala/scala@38babc2

@scabug
Copy link
Author

scabug commented Feb 20, 2014

@xeno-by said:
scala/scala#3569

@scabug scabug closed this as completed Feb 20, 2014
@scabug scabug added this to the 2.11.0-RC1 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants