uazu/stakker

Pass long path name to macro

veniamin-ilmer opened this issue · 2 comments

Working off the tutorial:

actor!(stakker, Light::init(), ret_nop!());

This works because Light is defined locally.

If I have Light defined in a separate module, I get an error with this code:

actor!(stakker, submodule::Light::init(), ret_nop!());

The current workaround:

use submodule::Light;
actor!(stakker, Light::init(), ret_nop!());
uazu commented

It's a limitation of macro_rules macros. I couldn't see any way to parse all of the :: sections except the last. So the workaround I adopted is to put the type-path in <...>, like this: actor!(stakker, <submodule::Light>::init(), ret_nop!());

OK, I will take this into account, thank you