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

Typechecking lazy vals is not idempotent #5466

Closed
scabug opened this issue Feb 14, 2012 · 5 comments
Closed

Typechecking lazy vals is not idempotent #5466

scabug opened this issue Feb 14, 2012 · 5 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Feb 14, 2012

Details:

@scabug
Copy link
Author

scabug commented Feb 14, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5466?orig=1
Reporter: @xeno-by
Affected Versions: 2.10.0
Blocks #5464

@scabug
Copy link
Author

scabug commented Dec 4, 2012

@xeno-by said:
No longer a problem after Hubert's recent refactoring to lazy val codegen.

@scabug
Copy link
Author

scabug commented Dec 4, 2012

@xeno-by said:
My bad. This is still a problem:

import scala.reflect.runtime.universe._
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
import scala.tools.reflect.Eval

object Test extends App {
  val lazee = reify {
    class C { lazy val x = 2 }
    new C().x
  }
  val tb = cm.mkToolBox()
  val tlazee = tb.typeCheck(lazee.tree)
  println(tlazee)
  val rtlazee = tb.resetAllAttrs(tlazee)
  println(tb.eval(rtlazee))
}

@scabug
Copy link
Author

scabug commented Dec 6, 2012

@xeno-by said:
See tests introduced in scala/scala@5028181

@scabug
Copy link
Author

scabug commented Nov 4, 2016

@xeno-by said:
Fixed in Scala 2.12.0. Thanks to Georgi Krastev for noticing: https://gitter.im/scalamacros/paradise?at=581c89b2c2f2cf7275cc7aac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants