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 local case classes #8505

Closed
scabug opened this issue Apr 15, 2014 · 2 comments
Closed

resetLocalAttrs does not work with local case classes #8505

scabug opened this issue Apr 15, 2014 · 2 comments
Assignees

Comments

@scabug
Copy link

scabug commented Apr 15, 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 {
     |   case class C()
     | }
<console>:10: error: C is already defined as (compiler-generated) case class companion object C
                case class C()
                           ^
@scabug
Copy link
Author

scabug commented Apr 15, 2014

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

@SethTisue
Copy link
Member

consolidating under #8500

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

3 participants