I just recently faced the same problem. My solution was to do a kind of two 
stage setup, where I have a untyped macro that produces a call to a typed 
macro. Something like this:
    
    
    macro typedStage(a: static SomeType, b: static SomeOtherType, body: typed) =
      produceFinalAst
    
    macro untypedStage(body: untyped) =
      ...
      let a = ...
      let b = ...
      let newBody: NimNode = ...
      
      quote do:
        typedStage(`a`, `b`, `newBody`)
    
    
    Run

Reply via email to