rune
rune copied to clipboard
Importing macros by `use` doesn't work
I registered a macro param
in crate latte
:
let mut latte_module = Module::with_crate("latte");
latte_module
.macro_(&["param"], move |ctx, ts| context::param(ctx, ¶ms, ts))
.unwrap();
Then I can access that macro in the rune source by using fully qualified name:
const FOO = latte::param!("foo", 100);
However this results in the compile error:
use latte::*;
const FOO = param!("foo", 100); // not found: param!
use latte::param;
const FOO = param!("foo", 100); // not found: param!
And the following code causes Rune compiler to fall into an infinite loop:
use ::latte::param;
const FOO = param!("foo", 100);
Well that's not good. Thanks for the report!
This is clearly a bug, but I think you can get through it by using Module::with_item
for now instead of the (apparently) under-tested crate resolution it'd use with Module::with_crate
.
It seems like the immediate issue with crate resolution has been fixed (or at least according to my testing). Closing this for now!