This probably won't hit very often, but any hygiene violation is a soundness problem.
The implementation in a macro_invocation is separated from its environment at the time of Scope's syntax_syntax!, and then reunited at macro expansion time. Instead:
the Expand walk needs to be over Elts and have an environment that gets set by extend_syntax (so I guess that extend_syntax needs to invoke Expand? Or it needs to reify the environment and store it in the Ast?) from negative evaluation of the Syntaxes.
evaluating Syntax needs to produce an environment binding macros to closures that capture their environment. The current function (generating a FormPat) would need to be handled by binding a special name in the environment, it seems.
This probably won't hit very often, but any hygiene violation is a soundness problem.
The
implementation
in amacro_invocation
is separated from its environment at the time ofScope
'ssyntax_syntax!
, and then reunited at macro expansion time. Instead:Expand
walk needs to be overElt
s and have an environment that gets set byextend_syntax
(so I guess thatextend_syntax
needs to invokeExpand
? Or it needs to reify the environment and store it in the Ast?) from negative evaluation of theSyntax
es.Syntax
needs to produce an environment binding macros to closures that capture their environment. The current function (generating aFormPat
) would need to be handled by binding a special name in the environment, it seems.