Thanks a lot LeuGim!! The template returning var typed works like a charm!

Still, does anyone know what's wrong with that proc? And why should I ever use 
proc(T: typedesc) instead of template(T: typedesc)?
    
    
    proc getMutableVal(key: int, t: typedesc): var t =  # <-- fail
      getTableOf(t)[key]
    
    template getMutableVal(key: int, t: typedesc): var typed =  # <-- fine
      getTableOf(t)[key]
    

Reply via email to