Add testcase for #14472 (#14921)

This commit is contained in:
Clyybber 2020-07-06 20:53:38 +02:00 • committed by GitHub
commit ebd97884a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

23
tests/arc/t14472.nim Normal file
View file

@ -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()