summary refs log tree commit diff stats
path: root/tests/objects
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-04-11 02:28:06 +0200
committerAraq <rumpf_a@web.de>2015-04-11 10:01:10 +0200
commitd89a20cc1d1ddc497807825c1a80597630e7fa63 (patch)
tree1eb86a6251455feed5210df2272e360a04a83c4b /tests/objects
parent670367e13b5310f627bb114973d7f99d4942bcc8 (diff)
downloadNim-d89a20cc1d1ddc497807825c1a80597630e7fa63.tar.gz
fixes #2509
Diffstat (limited to 'tests/objects')
-rw-r--r--tests/objects/trefobjsyntax2.nim19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/objects/trefobjsyntax2.nim b/tests/objects/trefobjsyntax2.nim
new file mode 100644
index 000000000..8ee209cc7
--- /dev/null
+++ b/tests/objects/trefobjsyntax2.nim
@@ -0,0 +1,19 @@
+# bug #2508
+
+type
+  GenericNodeObj[T] = ref object
+    obj: T
+
+  Node* = ref object
+    children*: seq[Node]
+    parent*: Node
+
+    nodeObj*: GenericNodeObj[int]
+
+proc newNode*(nodeObj: GenericNodeObj): Node =
+    result = Node(nodeObj: nodeObj)
+    newSeq(result.children, 10)
+
+var genericObj = GenericNodeObj[int]()
+
+var myNode = newNode(genericObj)