Macro access to members of object where macro is defined
- by Marc Grue
Say I have a trait Foo that I instantiate with an initial value
val foo = new Foo(6) // class Foo(i: Int)
and I later call a second method that in turn calls myMacro
foo.secondMethod(7) // def secondMethod(j: Int) = macro myMacro
then, how can myMacro find out what my initial value of i (6) is?
I didn't succeed with normal compilation…