twrongsymkind.nim 329 B

123456789101112131415161718192021
  1. discard """
  2. errormsg: "cannot use symbol of kind 'var' as a 'param'"
  3. line: 20
  4. """
  5. # bug #3158
  6. type
  7. MyData = object
  8. x: int
  9. template newDataWindow(data: ref MyData): untyped =
  10. proc testProc(data: ref MyData) =
  11. echo "Hello, ", data.x
  12. testProc(data)
  13. var d: ref MyData
  14. new(d)
  15. d.x = 10
  16. newDataWindow(d)