mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
20 lines
352 B
Nim
20 lines
352 B
Nim
# 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)
|