diff options
author | Araq <rumpf_a@web.de> | 2015-04-11 02:28:06 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-04-11 10:01:10 +0200 |
commit | d89a20cc1d1ddc497807825c1a80597630e7fa63 (patch) | |
tree | 1eb86a6251455feed5210df2272e360a04a83c4b /tests/objects | |
parent | 670367e13b5310f627bb114973d7f99d4942bcc8 (diff) | |
download | Nim-d89a20cc1d1ddc497807825c1a80597630e7fa63.tar.gz |
fixes #2509
Diffstat (limited to 'tests/objects')
-rw-r--r-- | tests/objects/trefobjsyntax2.nim | 19 |
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) |