summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorClyybber <darkmine956@gmail.com>2020-07-06 20:53:38 +0200
committerGitHub <noreply@github.com>2020-07-06 20:53:38 +0200
commitebd97884a0134ba2f88e19f647585aa6133536aa (patch)
tree6e2fe3dcafe92270ed89b5eaee4a692d2f7c5d4a /tests
parenta754160d654f03584088412f51b153ae6a170adb (diff)
downloadNim-ebd97884a0134ba2f88e19f647585aa6133536aa.tar.gz
Add testcase for #14472 (#14921)
Diffstat (limited to 'tests')
-rw-r--r--tests/arc/t14472.nim23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/arc/t14472.nim b/tests/arc/t14472.nim
new file mode 100644
index 000000000..47ed77f4c
--- /dev/null
+++ b/tests/arc/t14472.nim
@@ -0,0 +1,23 @@
+discard """
+  valgrind: true
+  cmd: "nim c --gc:arc -d:useMalloc $file"
+"""
+
+type
+  ImportMaterial* = object
+    # Adding a field here makes the problem go away.
+
+  Mesh* = object
+    vertices: seq[float32]
+    material: ImportMaterial
+
+  ImportedScene* = object
+    meshes*: seq[Mesh]
+
+proc bork() : ImportedScene =
+  var mats: seq[ImportMaterial]
+
+  setLen(mats, 1)
+  add(result.meshes, Mesh(material: mats[0]))
+
+var s = bork()