I tried to make macro that will return type depending on type I pass to it as argument
For example:
macro_rules! foo { ($t:ty) => (Option::<$t>) }
Everithing is OK until I try to do recursive macro invocation:
foo!(foo!(isize));
This should transform to Option::<Option::<isize>>. Instaed I get compilation error.
src/main.rs:77:11: 77:12 error: no rules expected the token `!`
src/main.rs:77 foo!(foo!(i32));
Is there any method to force macro expansion in place, before it will be passed into another macro?
Or maybe it not possible at all?
Or may be there some workaround you know?