I think I just had to remove the ref in Tmp definition:
    
    
    type
      Coord = ref object of RootObj
        x,y,z:float
      
      Pt* = ref object of Coord
      
      Tmp = ref object of RootObj
        tag:int
        point:Pt
    
    
    let a =  Pt(x:1.0, y:3.0,z:2.0)
    let b = a
    echo repr b
    
    et d = Tmp(tag: 4, point: b )
    echo repr d
    d.point.x = 2.0
    echo repr d
    echo repr b
    
    Run

This seems to work.

Reply via email to