t14472.nim 715 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. discard """
  2. valgrind: true
  3. cmd: "nim cpp --gc:arc -d:useMalloc --deepcopy:on $file"
  4. """
  5. type
  6. ImportMaterial* = object
  7. # Adding a field here makes the problem go away.
  8. Mesh* = object
  9. vertices: seq[float32]
  10. material: ImportMaterial
  11. ImportedScene* = object
  12. meshes*: seq[Mesh]
  13. proc bork() : ImportedScene =
  14. var mats: seq[ImportMaterial]
  15. setLen(mats, 1)
  16. add(result.meshes, Mesh(material: mats[0]))
  17. var s = bork()
  18. #------------------------------------------------------------------------
  19. # issue #15543
  20. import tables
  21. type
  22. cdbl {.importc: "double".} = object
  23. MyObject = ref object of RootObj
  24. y: Table[string, cdbl]
  25. proc test =
  26. var x = new(MyObject)
  27. test()