From d89a20cc1d1ddc497807825c1a80597630e7fa63 Mon Sep 17 00:00:00 2001 From: Araq Date: Sat, 11 Apr 2015 02:28:06 +0200 Subject: fixes #2509 --- tests/objects/trefobjsyntax2.nim | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/objects/trefobjsyntax2.nim (limited to 'tests/objects') 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) -- cgit 1.4.1-2-gfad0