I want to find a scoped symbol by name inside a macro. The symbol might be in a method, var or import. Is there a simple way of doing this? Eg access the Symbol Table?
Asked
Active
Viewed 57 times
0
-
Do you want to find something that uses that symbol inside a macro argument? Or you want to resolve a name to a symbol in a macro implementation? – Eugene Burmako Feb 12 '14 at 12:45
-
I wanted to resolve a name to a symbol inside a macro implementation. I'm trying to build a helper macro to create a trait instance using the local context. Something like: def foo(i : Int) = implement[SomeTrait] where implement is my macro and SomeTrait has an abstract val i : Int – user3293336 Feb 12 '14 at 13:32
-
Could you provide some more context, ideally in a gist with a couple examples of the transformation that you want to achieve? Theoretically, your task could be carried out by invoking `c.typeCheck`, but it'd be great to know more to provide more precise advice. – Eugene Burmako Feb 13 '14 at 00:24