I tried wrapping it in a template but there is an issue with cointainers:
    
    
    template defineOverload(value: untyped, typ: typedesc, body: untyped) =
      proc change(value: var typ) =
        body
      template hasOverload(t: typedesc[typ]): bool = true
    
    defineOverload(x, seq[int]):
      x = @[]
    
    type
      Foo[T] = object
        x: T
    
    defineOverload(x, seq[Foo[T]]): # how?
      x = @[]
    
    
    Run

Reply via email to