typalias.nim 191 B

12345678910111213141516
  1. type
  2. TMyObj = TYourObj
  3. TYourObj = object of RootObj
  4. x, y: int
  5. proc init: TYourObj =
  6. result.x = 0
  7. result.y = -1
  8. proc f(x: var TYourObj) =
  9. discard
  10. var m: TMyObj = init()
  11. f(m)