I have a Symbol
and want to check if it's visible at the point of macro expansion or shadowed (e.g. by a local variable), so that splicing the symbol's name in the quasiquote doesn't refer to something else.
Looking at http://docs.scala-lang.org/overviews/reflection/annotations-names-scopes.html, one idea would be to look at the enclosing lexical scopes and check if they contain a symbol with the same name; the problem is that I can't find a way to obtain the directly enclosing scope for the macro.