1 2 3 4 5 6 7 8 9 10 11
type TMyObj = object x: int proc gen*[T](): T = var d: TMyObj # access private field here d.x = 3 result = d.x