That's actually a regular question (pain point?) regarding macros. The current way is to preprocess using an untyped macro, and then dispatch/getAST from a typed macro when you need type resolution.
I remember seeing some discussion to ease that but they are pretty buried.