Closed
Description
When one macro invokes another macro, it always looks up the nested macro from the point of the outer invocation, instead of from the point of the macro definition. I don't know if this is intentional.
Example:
fn main() {
macro_rules! foo(
() => (println!("outer"))
);
{
macro_rules! bar(
() => (foo!())
);
{
macro_rules! foo(
() => (println!("inner"))
);
bar!()
}
}
}
If these were functions, it would print outer
, but instead it prints inner
.