You can deref with `[]` as in 
    
    
    type
      Foo = ref object
        a, b, c: int
    
    var
      x = Foo(a: 1, b: 2, c: 3)
      y = new Foo
    
    for name, v1, v2 in fieldPairs(y[], x[]):
      v1 = v2
    
    echo y[]
    
    
    Run

<https://play.nim-lang.org/#ix=3z5H>

Not sure why it doesn't work on `ref Object`

Reply via email to