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

resetLocalAttrs does not work with lazy val #8499

Closed
scabug opened this issue Apr 14, 2014 · 3 comments
Closed

resetLocalAttrs does not work with lazy val #8499

scabug opened this issue Apr 14, 2014 · 3 comments
Labels
Milestone

Comments

@scabug
Copy link

scabug commented Apr 14, 2014

Welcome to Scala version 2.10.3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_45).
Type in expressions to have them evaluated.
Type :help for more information.

scala> object Mover {
     |   import scala.reflect.macros.Context
     |   def moveTreeMacro(c: Context)(e: c.Expr[Any]): c.Expr[Any] = {
     |     import c._
     |     import c.universe._
     |     val ee = c.Expr(c.resetLocalAttrs(e.tree))
     |     reify {
     |       new AnyRef {
     |         def moved = {
     |           ee.splice
     |         }
     |       }
     |     }
     |   }
     |   import scala.language.experimental.macros
     |   def moveTree(e: Any): Any = macro moveTreeMacro
     | }
defined module Mover

scala> Mover.moveTree { lazy val a = 1 }
<console>:9: error: missing parameter type
              Mover.moveTree { lazy val a = 1 }
                                        ^
@scabug
Copy link
Author

scabug commented Apr 14, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8499?orig=1
Reporter: @Atry
Affected Versions: 2.10.3, 2.10.4
See #5464, #5466

@joroKr21
Copy link
Member

Works in 2.12 after lazy vals got reworked

@SethTisue SethTisue added this to the 2.12.0 milestone Feb 28, 2018
@SethTisue
Copy link
Member

@joroKr21 thanks for the ticket triage help, much appreciated

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

No branches or pull requests

4 participants