There is no type overload but this may work (though void is a bit tricky):
    
    
    type
      Action*[T] = when T is void: proc() {.nimcall.}
                   else: proc(arg: T){.nimcall.}
    
    
    Run

But the idiomatic way to solve that would be with push/pop
    
    
    {.push nimcall.} # Add nimcall pragma to all proc
    
    proc foo() = discard
    
    proc bar[T](arg: T) = discard
    
    {.pop.} # Stop adding the nimcall pragma
    
    proc baz[T](arg: T) = discard
    
    
    Run

Reply via email to